17 lines
490 B
Python
17 lines
490 B
Python
from database.ohlc import ohlc
|
|
from datetime import datetime, timedelta
|
|
from plotting import CandlestickChart, 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)
|
|
|
|
candlestick_chart = CandlestickChart(
|
|
x = data['Timestamp'],
|
|
opens = data['Open'],
|
|
highs = data['High'],
|
|
lows = data['Low'],
|
|
closes = data['Close'],
|
|
title = 'SPX'
|
|
)
|
|
plot(candlestick_chart) |