Notebook

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

Trend Follow Algo. Increased initial capital to $100,000,000. No change to code. Duration: 10.25 years.

In [1]:
bt = get_backtest('5b7421457c24534363b11b28')
100% Time: 0:00:57|###########################################################|
In [2]:
bt.create_full_tear_sheet(round_trips=True, hide_positions=True, live_start_date = "2016-01-01")
Start date2007-08-02
End date2017-12-29
In-sample months100
Out-of-sample months23
All In-sample Out-of-sample
Annual return 25.5% 23.1% 35.9%
Cumulative returns 963.4% 476.3% 84.5%
Annual volatility 24.7% 24.9% 23.6%
Sharpe ratio 1.04 0.96 1.42
Calmar ratio 0.94 0.85 1.36
Stability 0.94 0.91 0.57
Max drawdown -27.1% -27.1% -26.5%
Omega ratio 1.19 1.18 1.27
Sortino ratio 1.49 1.35 2.12
Skew -0.37 -0.42 -0.14
Kurtosis 2.82 2.87 2.48
Tail ratio 1.02 0.98 1.17
Daily value at risk -3.0% -3.0% -2.8%
Gross leverage 2.30 2.02 3.48
Daily turnover 3.9% 4.1% 3.1%
Alpha 0.24 0.22 0.21
Beta 0.21 0.17 0.79
Worst drawdown periods Net drawdown in % Peak date Valley date Recovery date Duration
0 27.13 2013-05-08 2013-06-24 2013-12-30 169
1 27.07 2011-04-29 2011-08-08 2013-04-29 522
2 26.49 2016-03-03 2016-11-11 2017-03-01 260
3 21.43 2008-07-02 2008-08-28 2008-11-19 101
4 20.48 2013-12-31 2014-04-11 2014-07-01 131
/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% -4.49% 5.76%
US downgrade/European Debt Crisis 0.35% -10.11% 9.03%
Fukushima 0.48% -2.60% 3.76%
EZB IR Event 0.06% -1.75% 2.75%
Aug07 0.12% -1.23% 1.74%
Mar08 -0.48% -4.35% 1.38%
Sept08 0.22% -4.49% 5.76%
2009Q1 0.34% -2.94% 3.56%
2009Q2 -0.18% -2.89% 3.56%
Flash Crash -0.89% -6.16% 5.28%
Apr14 0.08% -5.94% 3.78%
Oct14 0.58% -3.02% 4.89%
Fall2015 -0.00% -3.02% 1.64%
Low Volatility Bull Market 0.00% 0.00% 0.00%
GFC Crash 0.14% -4.81% 5.76%
Recovery 0.08% -10.11% 9.03%
New Normal 0.11% -6.59% 6.22%
/usr/local/lib/python2.7/dist-packages/matplotlib/axes/_base.py:2787: UserWarning: Attempting to set identical left==right results
in singular transformations; automatically expanding.
left=732889.0, right=732889.0
  'left=%s, right=%s') % (left, right))