-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchart_view.py
More file actions
54 lines (47 loc) · 1019 Bytes
/
chart_view.py
File metadata and controls
54 lines (47 loc) · 1019 Bytes
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
import plotille
import pandas as pd
import candle_store
import pandas as pd
import candle_store
def drawMarket(fig, data):
# fig.plot(
# data['reg'],
# data['open'],
# lc=4,
# label='First line',
# )
# fig.plot(
# data['reg'],
# data['close'],
# lc=4,
# label='First line'
# )
fig.scatter(
data['reg'],
data['high'],
lc=5,
)
fig.scatter(
data['reg'],
data['low'],
lc=6
)
def drawMA(fig, window_size, lc):
data = candle_store.getMA(window_size)
fig.plot(
data['reg'],
data['SMA'],
lc=lc
)
def showCandlePlot():
plotData = candle_store.plotData()
fig = plotille.Figure()
fig.width = 50
fig.height = 15
fig.color_mode = 'byte'
fig.set_x_limits(min_=0, max_=155)
drawMarket(fig, plotData)
drawMA(fig, window_size=15, lc=1)
drawMA(fig, window_size=50, lc=2)
print(fig.show())
showCandlePlot()