tradestation/get_options_chain_example.py

11 lines
311 B
Python

from tradestation import TradeStationClient
from datetime import datetime
from dotenv import load_dotenv
from os import getenv
load_dotenv()
client = TradeStationClient(getenv('TRADESTATION_REFRESH_TOKEN'))
options_chain = client.get_options_chain('$SPXW.X', expiration = datetime.now())
print(options_chain)