- Net premium sold today
- Net # of units for both calls and puts
- BP/NLV summary
- Order's used today (includes futures)
- List of outstanding premium and marks by expiration date
- Does not include closed positions (i.e. buybacks)
- 20 positions closest to being ITM
- List of all positions <40% OTM
What you will need:
-
TDA API Account (step 1)
- Both the API key for the app you register and the callback url
-
PM Account number
-
Docker (step 2)
- Create an account for TDA API
- Create an app, name doesn't matter
- Create a callback uri
- use "https://localhost" if you don't have a better one, it won't matter, just need to be something
- If you want to use docker
- Download docker desktop and install for your OS (https://www.docker.com/products/docker-desktop)
Note you will need to use the full path to the directory with the configuration file and API access token these instructions will assume that you are putting them in the "config" folder in the same directory
These commands are for *nix systems. If anyone could help me with windows instructions I would appreciate it I will gladly make/maintain batch scripts for windows once I can test out what should be in it
-
Download docker desktop
-
Pull the container
docker pull donrkabob/lottobuddy:latest
-
Create the config file (TDA api app key/url)
mkdir config docker run -p 5000:5000 -v `pwd`/config:/config donrkabob/lottobuddy:latest --setup --tdaconfig /config/tda-config.json --configfile /config/lotto_config.json
-
Set up API access refresh token
docker run -p 5000:5000 -v `pwd`/config:/config donrkabob/lottobuddy:latest --newtoken --tdaconfig /config/tda-config.json --configfile /config/lotto_config.json
-
Run the thing!
docker run -p 5000:5000 -v `pwd`/config:/config donrkabob/lottobuddy:latest --newtoken --tdaconfig /config/tda-config.json --configfile /config/lotto_config.json
the libraries you need are in the docker file and they will maintain the most up to date requirements.
Install libraries
pip3 install pandas
pip3 install tda-api flask
With these installed you can run:
python3 flask_buddy.py --setup
python3 flask_buddy.py --newtoken
python3 flask_buddy.py
-
Do you have git installed?
-
Try the command:
which git
-
See if you have python3
which python3
-
If it return nothing then it is not install otherwise it will print a system path
-
If it gives you an error you don't and let's install command line tools from apple
xcode-select --install
-
-
OK - do you need pip? If running "pip3" does not work then below will install pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py sudo python3 get-pip.py
-
Install packages
pip3 install --user pandas pip3 install --user tda-api flask
-
Clone repo
git clone https://github.com/don-r-kebab/lottobuddy.git
-
Move into that directory
cd lottobuddy
-
Set up config file
python3 flask_buddy.py --setup
-
Create token file
python3 flask_buddy.py --newtoken
-
Run it!
python3 flask_buddy.py
Most of the data is all on the dashboard. There is a link strip on top
- "STATS": The Main Dashboard
- "RED_ALERT": list all positions < 40% OTM
config file (format: JSON, default: 'lotto_config.json')
{
"apikey": "<API key>",
"callbackuri": "<callback url provided to TD API>",
"accountnum": "<account number>",
"tokenpath": "<API token file path>"
}
tokenpath will be set automatically, but can be changed manually either by hand in the config file or by command line option if desired.