-
Notifications
You must be signed in to change notification settings - Fork 0
/
SupportResistance.py
65 lines (29 loc) · 904 Bytes
/
SupportResistance.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
"""
main method
"""
from SupportResistanceMethod import *
from lineCalc import *
import matplotlib.pyplot as plt
import pandas as pd
######## main method ##########
symbol = "BTC-USD"
#number is in days, if the number is greater than the number of days the stock has been on the market, the plot will display all available data
data,hist,bean = getData(symbol,1000)
date = bean.iloc[0]
date = str(date.name)
#get lines s - 0 , r - 1
intervals = [23,45]
sLines,rLines,aLines,intervals = getLines(data,True,intervals,True)
plt.plot(data)
for s in sLines:
plotLine(s[0],s[1],len(data),"s",data)
for r in rLines:
plotLine(r[0],r[1],len(data),"r",data)
for a in aLines:
plotLine(a[0],a[1],len(data),"a",data)
plt.title("Closing Prices with Support and Resistance Lines\nSymbol:"+symbol+" Since " + date)
plt.show()
"""
Crash cases:
Issues:
"""