Notebook

From: https://www.quantopian.com/algorithms/5b795d68b0c972003dd5c309/5b7b340624ad7943e3da9691/old

Base Strategy: https://www.quantopian.com/posts/value-momentum-and-trend#5b7910c3808456001f56758c

There are similarities in the trading behavior with the strategy I tested in the "Trend Follow Algo" thread. Have not read the code, but might get to it. At least, it showed it could handle the load, meaning the $\$$10M in initial capital. For its 15.6-year simulation, with its 6,000+ trades, it came in at a respectable 27.3$\%$ CAGR.

In [1]:
bt = get_backtest('5b7b340624ad7943e3da9691')
100% Time: 0:03:06|###########################################################|
In [2]:
bt.create_full_tear_sheet(round_trips=True, hide_positions=True, live_start_date = "2016-01-01")
Start date2002-10-18
End date2018-08-01
In-sample months158
Out-of-sample months30
All In-sample Out-of-sample
Annual return 27.3% 28.4% 21.9%
Cumulative returns 4393.8% 2597.3% 66.6%
Annual volatility 21.4% 21.7% 19.5%
Sharpe ratio 1.24 1.26 1.11
Calmar ratio 0.96 0.99 1.89
Stability 0.94 0.95 0.95
Max drawdown -28.5% -28.5% -11.6%
Omega ratio 1.24 1.25 1.20
Sortino ratio 1.79 1.83 1.56
Skew -0.29 -0.25 -0.59
Kurtosis 2.57 2.67 1.45
Tail ratio 0.98 1.00 0.97
Daily value at risk -2.6% -2.6% -2.4%
Gross leverage 1.13 1.14 1.09
Daily turnover 3.1% 3.2% 2.5%
Alpha 0.19 0.21 0.04
Beta 0.64 0.60 1.17
Worst drawdown periods Net drawdown in % Peak date Valley date Recovery date Duration
0 28.55 2010-04-26 2010-08-24 2011-01-12 188
1 23.31 2006-05-10 2006-06-13 2007-04-12 242
2 21.54 2015-07-16 2016-02-09 2016-12-20 374
3 20.82 2007-07-13 2007-08-16 2007-12-24 117
4 20.07 2011-07-22 2011-08-08 2012-03-09 166
/usr/local/lib/python2.7/dist-packages/numpy/lib/function_base.py:3834: RuntimeWarning: Invalid value encountered in percentile
  RuntimeWarning)
Stress Events mean min max
Lehmann -0.00% -0.48% 0.53%
US downgrade/European Debt Crisis 0.23% -8.22% 7.42%
Fukushima 0.23% -1.55% 2.64%
US Housing 0.01% -0.10% 0.06%
EZB IR Event -0.18% -2.53% 2.14%
Aug07 -0.14% -4.97% 3.69%
Mar08 -0.11% -2.54% 1.84%
Sept08 -0.04% -0.48% 0.53%
2009Q1 -0.12% -1.58% 1.88%
2009Q2 0.06% -1.21% 1.54%
Flash Crash -0.40% -4.00% 6.60%
Apr14 -0.03% -3.58% 2.25%
Oct14 0.08% -4.17% 4.38%
Fall2015 -0.17% -5.05% 5.87%
Low Volatility Bull Market 0.15% -5.77% 5.96%
GFC Crash 0.00% -5.28% 4.08%
Recovery 0.10% -8.22% 7.42%
New Normal 0.08% -5.12% 5.87%