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
234
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
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.
7 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.

Clone Algorithm
155
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
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: 5b78e2c0f3412743bbcd270d
There was a runtime error.

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.

Loading notebook preview...
Notebook previews are currently unavailable.

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