This algorithm is inspired by Alpha Architect's VMOT ETF which combines value, momentum and trend to generate alpha based on the two factors while retaining downside protection through trend following. The backtest attached is a starting attempt to recreate a similar strategy combining two codes on Quantopian, one value focused and the other momentum focused. I was interested to see if the Quantopian community would be able to improve on the code. My initial ideas that are beyond my coding ability are:
- Apply trend moving average globally (currently applied to both value and momentum individually, lines 28 & 81)
- Apply safe haven ETF globally (currently applied to only value line 67, not applied to momentum)
- Remove safe haven ETF safe havens (Lines 68, 69, 70)
- Change momentum half code to buy a fixed, equally weighted 10 positions (currently applies varying weights, sometimes buys less than 10)
- Ability to adjust the rebalance frequency for value and momentum sections individually (e.g. quarterly for value, monthly for momentum)
- Eliminate duplicate sell orders which results in shorting (during rebalance two sell orders can be placed for a single stock at once)
- Ability to make the EV/EBITDA filter (line 187) dynamic (e.g. EV/EBITDA <= cheapest 10% of total market ranked by EV/EBITDA)
- Add a Piotroski score as a quality filter to the value section to test out