Add example of plotting a chart with multiple lines
This commit is contained in:
parent
49e0c4c9bd
commit
81ae787aa5
15
multi_line_chart_example.py
Normal file
15
multi_line_chart_example.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
from database.ohlc import ohlc
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
|
from line_chart import LineChart
|
||||||
|
from plot import plot
|
||||||
|
|
||||||
|
end_date = datetime.today().date()
|
||||||
|
start_date = (end_date - timedelta(days = 90))
|
||||||
|
data = ohlc('SPX.XO', '1d', start_date = start_date, end_date = end_date)
|
||||||
|
|
||||||
|
line_chart = LineChart(
|
||||||
|
x = data['Timestamp'],
|
||||||
|
values = [data['High'], data['Low']]
|
||||||
|
)
|
||||||
|
plot(line_chart)
|
Loading…
Reference in New Issue
Block a user