Notebook

Dr. Gary Antonacci, portfolio consultant and author of Dual Momentum Investing, presented "Dual Momentum Investing" at our annual quant trading conference, QuantCon. You can check out the video of his talk at our blog and read through his presentation deck. The notebook below replicates the rotating momentum strategy study found in the talk.

The talk is centered around the following three concepts:

1. Past momentum is a good indicator of forward momentum
2. Relative momentum should not be ignored in momentum trading
3. Cyclicly moving to new momentum indices protects against drawdowns

Dual Momentum

The Quantopian lectures greatly detail the idea of momentum, the price change over some number of days.

As presented by Dr. Gary A. during QuantCon 2016,introducing relative momentum between indices allows for a more robust strategy. The idea has an analogue in pairs trading and cointegration.

Below is a flowchart diagramming his original strategy.

Image of Momentum

The implementation below includes logic to buy aggregate bonds during periods of overall negative momentum.

To view an expanded view of the backtest tearsheet, click the left margin of the cell

In [1]:
bt = get_backtest('57b74a64fc177d10093c9514')
bt.create_full_tear_sheet()
100% Time: 0:00:06|###########################################################|
Entire data start date: 2008-06-10
Entire data end date: 2016-08-18


Backtest Months: 98
                   Backtest
annual_return          0.11
annual_volatility      0.14
sharpe_ratio           0.85
calmar_ratio           0.60
stability              0.90
max_drawdown          -0.19
omega_ratio            1.18
sortino_ratio          1.23
skewness              -0.11
kurtosis               4.19
information_ratio      0.01
alpha                  0.09
beta                   0.32

Worst Drawdown Periods
   net drawdown in %  peak date valley date recovery date duration
0              18.91 2015-05-15  2016-06-27           NaT      NaN
2              11.96 2010-04-23  2010-05-26    2011-01-12      189
3               9.17 2012-04-02  2012-06-04    2012-08-09       94
1               8.16 2014-07-24  2014-10-16    2014-11-05       75
4               6.68 2013-12-31  2014-02-03    2014-03-04       46


2-sigma returns daily    -0.017
2-sigma returns weekly   -0.031
dtype: float64
/usr/local/lib/python2.7/dist-packages/matplotlib/__init__.py:892: UserWarning: axes.color_cycle is deprecated and replaced with axes.prop_cycle; please use the latter.
  warnings.warn(self.msg_depr % (key, alt_key))
Stress Events
                                    mean    min    max
Lehmann                           -0.000 -0.010  0.006
US downgrade/European Debt Crisis  0.000 -0.012  0.008
Fukushima                          0.001 -0.019  0.015
EZB IR Event                      -0.000 -0.010  0.016
Sept08                            -0.000 -0.006  0.006
2009Q1                            -0.000 -0.005  0.008
2009Q2                             0.003 -0.036  0.046
Flash Crash                       -0.003 -0.034  0.043
Apr14                              0.001 -0.021  0.011
Oct14                              0.001 -0.020  0.019
Fall2015                          -0.002 -0.040  0.039
GFC Crash                          0.000 -0.031  0.021
Recovery                           0.001 -0.038  0.046
New Normal                         0.000 -0.040  0.039

Top 10 long positions of all time (and max%)
[u'VEU-33486' u'SPY-8554' u'AGG-25485' u'SHY-23911']
[ 1.001  1.     1.     0.527]


Top 10 short positions of all time (and max%)
[]
[]


Top 10 positions of all time (and max%)
[u'VEU-33486' u'SPY-8554' u'AGG-25485' u'SHY-23911']
[ 1.001  1.     1.     0.527]


All positions ever held
[u'VEU-33486' u'SPY-8554' u'AGG-25485' u'SHY-23911']
[ 1.001  1.     1.     0.527]


Feel free to apply your own set of Momentum ETFs and Bonds to the algorithm, or change the tests for your own needs.

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory or other services by Quantopian. In addition, the content of the website neither constitutes investment advice nor offers any opinion with respect to the suitability of any security or any specific investment. Quantopian makes no guarantees as to accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.