20 lines
549 B
Python
20 lines
549 B
Python
from database.ohlc import ohlc
|
|
from datetime import datetime, timedelta
|
|
|
|
from line import Line
|
|
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'],
|
|
lines = [
|
|
Line(data['High'], name = 'High', color = 'limegreen'),
|
|
Line(data['Low'], name = 'Low', color = 'red')
|
|
],
|
|
title = 'SPX (High, Low)'
|
|
)
|
|
plot(line_chart) |