Getting Started
Before using this SDK, ensure that you:
Install
pip install tastytrade-sdk
Use It
from tastytrade_sdk import Tastytrade
tasty = Tastytrade()
tasty.login(
login='trader@email.com',
password='password'
)
tasty.api.post('/sessions/validate')
tasty.logout()
Examples
Streaming Market Data
from tastytrade_sdk import Tastytrade
tasty = Tastytrade().login(login='trader@email.com', password='password')
symbols = [
'BTC/USD',
'SPY',
'/ESU3',
'SPY 230630C00255000',
'./ESU3 EW2N3 230714C4310'
]
subscription = tasty.market_data.subscribe(
symbols=symbols,
on_quote=print,
on_candle=print,
on_greeks=print
)
subscription.open()