-
Trade only on a single designated day per week
- Open positions only if S&P500 above its 200 days MA
-
Rank all stocks based on volatility adjusted momentum
- Slop exponential regression based on past 90 days
- Multiply with the coefficient of determination R^2 for the same period
- Disqualify stocks which is trading below 100 days moving average or a recent gap in excess of 15%
- Calculate position sizes using the Average True Range (ATR) formula for 20 days
- Account_Value * Risk_Factor / ATR20
-
Re-balance portfolio once a week on the designated day
-
Check if a stock needs to be sold
- No longer in the top 20% of the volatility adjusted momentum ranking
- Trading below its 100 days MA
- A gap over 15%
- Is not anymore a part of the index
-
If cash available after the portfolio re-balancing process
- Check if the index in positive trend by verifying it is above its 200 days MA
- Buy from the top of the list following the same ranking rule as described in step 2 by verifying
- The stock is not already owned (and)
- It is in the top 20% of the momentum ranked list
- buy till we run out of cash
-
-
Re-balance portfolio positions every other time of the designated day
- Re-calculate the target size same as step 2.4 but with the updated portfolio size value and ATR20 values
- Compare target size with actual size
- re-balance if needed
- Open
config.yaml
and put in your parameter preferences - Install requirements:
python -m pip install -r requirements.txt
- Run
momentum_data.py
to aggregate the price data - Run
momentum_posis.py
to aggregate your momentum positions list - Create an Excel file of the positions you opened and place them in the portfolio file
- Example:
portfolio/start_date.xlsx
- Example:
- Run
momentum_data.py
to aggregate the price data - Run
momentum_posis.py
to aggregate your momentum positions list - Run
portfolio_rebalance_once_week.py
- Short the stocks which violate the rules as described in section 3 of trading strategy description
- Open new positions if the S&P500 above its 200-days MA based on the recent generated output file
- New positions of stocks that we do not already own
- Execute the Portfolio re-balance procedure
- Run
position_rebalance_once_every_two_weeks.py
- Re-balance positions if significant differences are present between current portfolio positions & suggested positions