- A TD Ameritrade account is required.
- A Finnhub.io account is required only if processing Crypto quotes.
- Install package requirements from
requirements.txt
- Create a config file (sample provided) config.json, fill in the "API_KEY" vars.
- Create portfolio JSON files (samples provided) named .json. For example
webull.json
. Entries in this file is: Portfolio, Symbol, Number of Shares, Cost. - Create a copy of the .env_sample to .env and edit to suit.
- Run the authentication for the first time:
./stocks.py -a
There are 2 types of portfolio files:
- TD Account Portfolio
Example:
{
"NAME": "TD_ACOUNT",
"ACCOUNT": "576825539"
}
- Non-TD Portfolio or Crypto
Note that crypto needs to be in a separate crypto.json
file.
Example:
{
"__COMMENTS__": "Ticker, # of Shares, $ Cost., Optional $ Price",
"NAME": "ROBINHOOD",
"HOLDINGS": {
"SEV": [
50,
10.25
],
"GSAT": [
200,
1.56,
1.99 # This is an optional element to define a price (if quote not available.)
],
}
}
- Help:
./stocks.py -h
- Stats:
./stocks.py -s
- Portfolio View:
./stocks.py -p <portfolio>
- All Portfolios:
./stocks.py -a all
- All Portfolios (show Crypto and Unvested):
./stocks.py -a all -ic -iu
- You can track "unvested" stocks, i.e. restricted stock units. Name the porfolio *UNVESTED, and it will automaticlly be excluded from view unless the
-iu, --unvested
options are used. - Crypto must be tracked in a separate
crypto.json
file and is automatically excluded from view unless the-ic, --crypto
options are used.