Gets specified quote prices every second & saves it to a mysql database.
I can't find 'free' reliable data like this online... So I wrote this containerized app to begin collecting data for me.
You can only get historical data at the minute level from the TDAmeritrade API... Even then, you can only get the last ~2 months of it...
Rename .env.example
to .env
or duplicate the file with the name .env
...
Register for a TDAmeritrade Developer account & create a new application from their site here. Then paste in your Application API Key & Redirect URI into the .env
file.
Also write in whichever stocks you want to keep track of - comma delimited in the .env
file as-well.
Prior to deploying this application to a headless server, you need to run the authentication script locally. The authentication script uses Selenium webdriver & expects Chrome to be installed on your machine... You can modify the script yourself to use Firefox, or whichever browser you prefer (I don't think newer versions of Safari support it)...
make auth
After successfully running the authentication script above, you can either clone this repo to your server & copy over the generate secrets/token.json file; or copy the local version of this repo that already has the token.json file...
Just incase you already have an older built version, throw the clean on there.
make clean && make build
After building, you can run the application simply with:
make run
Want to export the data to .CSV format? There's already a small script here that lets you do that by ticker & date (daily). You'll be prompted for that information after running the below:
make csv
WIP.