Notebook

From: https://www.quantopian.com/algorithms/5b71fa2d9de4f300406e0f85/5b71fa49cb06a4436d21f4d9/old

Trend Follow Algo. Only increased initial capital to $1,000,000. No change to code. Duration: 9.08 years.

In [1]:
bt = get_backtest('5b71fa49cb06a4436d21f4d9')
100% Time: 0:00:06|###########################################################|
In [2]:
bt.create_full_tear_sheet(round_trips=True, hide_positions=True, live_start_date = "2016-01-01")
Start date2007-08-09
End date2016-10-25
In-sample months100
Out-of-sample months9
All In-sample Out-of-sample
Annual return 23.5% 26.9% -7.1%
Cumulative returns 596.4% 639.4% -5.8%
Annual volatility 26.1% 26.3% 23.8%
Sharpe ratio 0.94 1.04 -0.19
Calmar ratio 0.92 1.05 -0.35
Stability 0.95 0.95 0.62
Max drawdown -25.6% -25.6% -20.4%
Omega ratio 1.17 1.19 0.97
Sortino ratio 1.34 1.49 -0.26
Skew -0.28 -0.28 -0.32
Kurtosis 2.28 2.37 0.70
Tail ratio 0.97 0.97 0.96
Daily value at risk -3.2% -3.2% -3.0%
Gross leverage 2.17 2.17 2.19
Daily turnover 4.9% 4.9% 4.9%
Alpha 0.24 0.27 -0.05
Beta 0.08 0.08 0.09
Worst drawdown periods Net drawdown in % Peak date Valley date Recovery date Duration
0 25.63 2011-04-29 2011-08-08 2013-04-04 505
1 20.40 2016-02-29 2016-10-11 NaT NaN
2 20.19 2009-03-09 2009-06-15 2009-09-08 132
3 19.85 2008-07-02 2008-08-11 2008-10-08 71
4 18.92 2014-09-05 2014-10-16 2014-12-22 77
/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.08% -4.81% 6.77%
US downgrade/European Debt Crisis 0.35% -8.50% 7.77%
Fukushima 0.48% -2.57% 3.69%
EZB IR Event 0.05% -2.64% 3.24%
Aug07 -0.10% -3.75% 1.76%
Mar08 -0.43% -4.09% 1.61%
Sept08 0.36% -4.81% 6.77%
2009Q1 0.33% -2.91% 3.57%
2009Q2 -0.20% -3.23% 3.75%
Flash Crash -0.80% -5.53% 4.89%
Apr14 0.02% -5.54% 3.37%
Oct14 0.38% -3.38% 5.53%
Fall2015 0.00% -3.45% 2.12%
GFC Crash 0.15% -5.36% 6.77%
Recovery 0.09% -9.16% 7.77%
New Normal 0.08% -7.23% 7.30%