The idea of this script is coming from the discord server of https://www.reddit.com/r/hebelwerk/ which is https://discord.gg/hebelwerk.
My adjustments of the code are based on the initial version written by member fcyolohama
.
- Open the latest successful run here: https://github.com/skyte/momentum/actions
- Download
exe-package
at the bottom (need to be logged in into github) - Exctract the
momentum
folder and enter it- If needed open
config.yaml
and put in your preferences
- If needed open
- Run
momentum.exe
- Open
config.yaml
and put in your preferences - Install requirements:
python -m pip install -r requirements.txt
- Run
momentum.py
Instead of running momentum.py
you can also:
- Run
momentum_data.py
to aggregate the price data - Run
momentum_posis.py
to aggregate your momentum positions list
- in the
output
folder you will find:- your default list of positions:
mmtm_posis.csv
- your default TradingView watchlist:
Momentum.txt
- as well as the same thing for all other momentum calculations that you defined
- in
config.yaml
add or remove values fromMOMENTUM_CALCULATION_PAST_DAYS
- in
- your default list of positions:
You can create a config_private.yaml
next to config.yaml
and overwrite some parameters like API_KEY
. That way you don't get conflicts when pulling a new version.
Can be switched with the field DATA_SOURCE
(Benchmark: Loads 1500 Stocks in 20m)
- Is default, no config necessary.
(Benchmark: Loads 1500 Stocks in 18m)
- Create TDAmeritrade Developer Account and App
- Put in your
API_KEY
inconfig.yaml
and changeDATA_SOURCE
.
Exponential regression is calculated like in this Excel graphic from the book: http://www.followingthetrend.com/stocks-on-the-move-figures-and-charts/#prettyPhoto[gallery]/15/
There is also a TradingView Indicator available: https://www.tradingview.com/script/QWHjwm4B-Exponential-Regression-Slope-Annualized-with-R-squared-Histogram/