2024-01-01 14:00:29 +00:00
|
|
|
from database.ohlc import ohlc
|
|
|
|
from datetime import datetime, timedelta
|
|
|
|
|
2024-01-04 13:26:58 +00:00
|
|
|
from line import Line
|
2024-01-01 14:00:29 +00:00
|
|
|
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'],
|
2024-01-04 13:26:58 +00:00
|
|
|
lines = [
|
|
|
|
Line(data['High'], name = 'High', color = 'limegreen'),
|
|
|
|
Line(data['Low'], name = 'Low', color = 'red')
|
|
|
|
],
|
2024-01-03 14:32:29 +00:00
|
|
|
title = 'SPX (High, Low)'
|
2024-01-01 14:00:29 +00:00
|
|
|
)
|
|
|
|
plot(line_chart)
|