Quantopian's community platform is shutting down. Please read this post for more information and download your code.
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
9 responses

William,

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,
JJ

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

I updated the algorithm to make compatible with new version of quantopian API.

Nice job, John.

Has anyone tried applying a similar "fundamentals quality" filter on the momentum portion, i.e compensating having smaller (micro etc) lists with a filter for >0 QoQ/YoY profitability and growth?

It should be noted that this trading strategy can support a $10M initial stake and still provide a nice and relatively smooth equity curve. It is also something that can maintain a 25-30% CAGR over those 16 years. I intend to investigate further.

Tearsheet attached with $10M initial capital scenario. Over its 15.6 years, it managed to maintain a 27.3% CAGR. It is getting interesting. However, I am already getting bored with it. Most probably, looking for something else.

hello together im new on quantopian and i would like to run this algo in a live trading Account is that possible?

I'm combing through algos (mostly momentum) to see how they have fared out of sample and how they have reacted to this current crash. An interesting exercise. This one has not fared well.

I keep getting the "Something Went Wrong" error when trying to run the backtest. Does anyone know what might be wrong?Thanks