Closed fritol closed 6 months ago
This can be done with the DXLinkStreamer
async with DXLinkStreamer(session) as streamer:
subs = ['SPY', 'AAPL']
await streamer.subscribe_candle(subs, '1d', start_date)
candle = await streamer.get_event(EventType.CANDLE)
OHLC data is obtained through Candle
events. See more here:
https://tastyworks-api.readthedocs.io/en/latest/sessions.html#events
https://tastyworks-api.readthedocs.io/en/latest/tastytrade.html#tastytrade.streamer.DXLinkStreamer.subscribe_candle
This can be done with the DXLinkStreamer
async with DXLinkStreamer(session) as streamer: subs = ['SPY', 'AAPL'] await streamer.subscribe_candle(subs, '1d', start_date) candle = await streamer.get_event(EventType.CANDLE)
Is this supposed to work with futures contracts as well?
Yes, you'll need to use dxfeed notation for futures though: https://tastyworks-api.readthedocs.io/en/latest/dxfeed.html
Is there any way to pull historical data? I mean how does their web UI pull chart data?