2023-12-29 15:16:11 +00:00
|
|
|
from database.ohlc import ohlc
|
|
|
|
from datetime import datetime, timedelta
|
2024-01-30 19:16:06 +00:00
|
|
|
from plotting import CandlestickChart, plot
|
2023-12-29 15:16:11 +00:00
|
|
|
|
|
|
|
end_date = datetime.today().date()
|
2023-12-31 15:15:53 +00:00
|
|
|
start_date = (end_date - timedelta(days = 90))
|
2023-12-29 15:16:11 +00:00
|
|
|
data = ohlc('SPX.XO', '1d', start_date = start_date, end_date = end_date)
|
|
|
|
|
|
|
|
candlestick_chart = CandlestickChart(
|
|
|
|
x = data['Timestamp'],
|
|
|
|
opens = data['Open'],
|
|
|
|
highs = data['High'],
|
|
|
|
lows = data['Low'],
|
2024-01-03 14:32:29 +00:00
|
|
|
closes = data['Close'],
|
|
|
|
title = 'SPX'
|
2023-12-29 15:16:11 +00:00
|
|
|
)
|
2023-12-31 14:12:37 +00:00
|
|
|
plot(candlestick_chart)
|