This is a simple python script for monitoring at-the-money vertical option chains utilizing the TD Ameritrade API.
Run with python vertical_watcher.py symbol
where symbol
is the underlying you
wish to monitor. Default is SPX. The TD API supports tradable underlyings
except futures and forex. Some indexes are supported including SPX.
2787.80 (+0.01) [+++ +-+---- ++-++-+]
last price (change) [trendline]
C (0 dte)
Call/Put (days to expiration)
2765.0/2770.0: M:5.15 (4.90/5.40) D:0.00, T:0.00
low/high legs: M:mark (bid / ask) D:Delta T:theta
To use this script, you need a TD account with developer access.
Once you have developer access, follow the steps here to obtain a refresh token: https://developer.tdameritrade.com/content/simple-auth-local-apps
Insert your account number, client ID, and refresh token in the constants at the head of the script.
The script sends an OSX alert any time the underlying crosses a strike. If you aren't using OSX, disable this component.