Back to Community
Value, Momentum & Trend

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
Clone Algorithm
Backtest from to with initial capital
Total Returns
Max Drawdown
Benchmark Returns
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 594c2fd248d0a3698053797a
There was a runtime error.
2 responses


Thank you for posting. I am relatively new to Quantopian and have been using your code as a base to investigate a few strategies. I was doing some tinkering and exploring the effects of changing some parameters when get_fundamentals was deprecated and the code broke. You wouldn't have a version of this using just the pipeline? My python skills are improving, but this is beyond my current skill set.

Thank you in advance,

I am struggling to make this run after the update. Can anyone help me?