Notebook
In [53]:
import pyfolio as pf
import empyrical as ep

ML_10

In [54]:
bt = get_backtest('5d50daa355dfd760cf9095c6')
returns = bt.daily_performance['returns']
100% Time: 0:00:55|###########################################################|
In [55]:
cum_returns = ep.cum_returns(returns)
ax = cum_returns.plot(figsize=(14,5))
ax.set(title='Cumulative Returns', ylabel='returns', xlabel='date');
In [56]:
benchmark_rets = pf.utils.get_symbol_rets('SPY')
pf.plotting.show_perf_stats(returns, benchmark_rets)
Start date2004-07-01
End date2019-07-30
Total months180
Backtest
Annual return -14.1%
Cumulative returns -89.8%
Annual volatility 31.3%
Sharpe ratio -0.33
Calmar ratio -0.15
Stability 0.87
Max drawdown -94.7%
Omega ratio 0.94
Sortino ratio -0.46
Skew 0.18
Kurtosis 7.13
Tail ratio 0.98
Daily value at risk -4.0%
Alpha 0.04
Beta -1.46

WML_10

In [57]:
bt = get_backtest('5d4bbe77635fc761fbd6a6ba')
returns = bt.daily_performance['returns']
100% Time: 0:01:21|###########################################################|
In [58]:
cum_returns = ep.cum_returns(returns)
ax = cum_returns.plot(figsize=(14,5))
ax.set(title='Cumulative Returns', ylabel='returns', xlabel='date');
In [59]:
benchmark_rets = pf.utils.get_symbol_rets('SPY')
pf.plotting.show_perf_stats(returns, benchmark_rets)
Start date2004-07-01
End date2019-07-30
Total months180
Backtest
Annual return 0.3%
Cumulative returns 4.0%
Annual volatility 10.1%
Sharpe ratio 0.08
Calmar ratio 0.01
Stability 0.06
Max drawdown -49.4%
Omega ratio 1.01
Sortino ratio 0.10
Skew -0.51
Kurtosis 4.01
Tail ratio 0.93
Daily value at risk -1.3%
Alpha 0.02
Beta -0.08

W_10

In [60]:
bt = get_backtest('5d4be0ad94c20a5f02b26a51')
returns = bt.daily_performance['returns']
100% Time: 0:00:50|###########################################################|
In [61]:
cum_returns = ep.cum_returns(returns)
ax = cum_returns.plot(figsize=(14,5))
ax.set(title='Cumulative Returns', ylabel='returns', xlabel='date');
In [62]:
benchmark_rets = pf.utils.get_symbol_rets('SPY')
pf.plotting.show_perf_stats(returns, benchmark_rets)
Start date2004-07-01
End date2019-07-30
Total months180
Backtest
Annual return 7.3%
Cumulative returns 187.3%
Annual volatility 25.9%
Sharpe ratio 0.40
Calmar ratio 0.11
Stability 0.58
Max drawdown -64.3%
Omega ratio 1.07
Sortino ratio 0.55
Skew -0.36
Kurtosis 4.76
Tail ratio 0.91
Daily value at risk -3.2%
Alpha -0.02
Beta 1.22

VOLATILITY-TIMED WINNERS APPROACH

W10_T_RV PLUS BILL

In [63]:
bt = get_backtest('5d50eb1655dfd760cf909657')
returns = bt.daily_performance['returns']
100% Time: 0:00:42|###########################################################|
In [64]:
cum_returns = ep.cum_returns(returns)
ax = cum_returns.plot(figsize=(14,5))
ax.set(title='Cumulative Returns', ylabel='returns', xlabel='date');
In [65]:
benchmark_rets = pf.utils.get_symbol_rets('SPY')
pf.plotting.show_perf_stats(returns, benchmark_rets)
Start date2004-07-01
End date2019-07-30
Total months180
Backtest
Annual return 9.2%
Cumulative returns 274.5%
Annual volatility 18.6%
Sharpe ratio 0.56
Calmar ratio 0.33
Stability 0.94
Max drawdown -27.8%
Omega ratio 1.11
Sortino ratio 0.77
Skew -0.51
Kurtosis 3.20
Tail ratio 0.90
Daily value at risk -2.3%
Alpha 0.05
Beta 0.53

W_10_T_RV PLUS BONDS

In [66]:
bt = get_backtest('5d3fe53facbdb260290cda96')
returns = bt.daily_performance['returns']
100% Time: 0:00:42|###########################################################|
In [67]:
cum_returns = ep.cum_returns(returns)
ax = cum_returns.plot(figsize=(14,5))
ax.set(title='Cumulative Returns', ylabel='returns', xlabel='date');
In [68]:
benchmark_rets = pf.utils.get_symbol_rets('SPY')
pf.plotting.show_perf_stats(returns, benchmark_rets)
Start date2004-07-01
End date2019-07-19
Total months180
Backtest
Annual return 11.0%
Cumulative returns 377.7%
Annual volatility 19.7%
Sharpe ratio 0.63
Calmar ratio 0.39
Stability 0.96
Max drawdown -27.8%
Omega ratio 1.11
Sortino ratio 0.86
Skew -0.44
Kurtosis 2.21
Tail ratio 0.91
Daily value at risk -2.4%
Alpha 0.08
Beta 0.40

W10_T_DV PLUS BONDS

In [69]:
bt = get_backtest('5d3fdb6c2453ed623508fe4d')
returns = bt.daily_performance['returns']
100% Time: 0:00:32|###########################################################|
In [70]:
cum_returns = ep.cum_returns(returns)
ax = cum_returns.plot(figsize=(14,5))
ax.set(title='Cumulative Returns', ylabel='returns', xlabel='date');
In [71]:
benchmark_rets = pf.utils.get_symbol_rets('SPY')
pf.plotting.show_perf_stats(returns, benchmark_rets)
Start date2004-07-01
End date2019-07-19
Total months180
Backtest
Annual return 15.4%
Cumulative returns 765.8%
Annual volatility 15.1%
Sharpe ratio 1.03
Calmar ratio 0.83
Stability 0.98
Max drawdown -18.6%
Omega ratio 1.19
Sortino ratio 1.46
Skew -0.40
Kurtosis 2.03
Tail ratio 0.97
Daily value at risk -1.8%
Alpha 0.15
Beta 0.09

W10_T_ATR PLUS BONDS

In [72]:
bt = get_backtest('5d4e9989659d76619c1338cf')
returns = bt.daily_performance['returns']
100% Time: 0:00:37|###########################################################|
In [73]:
cum_returns = ep.cum_returns(returns)
ax = cum_returns.plot(figsize=(14,5))
ax.set(title='Cumulative Returns', ylabel='returns', xlabel='date');
In [74]:
benchmark_rets = pf.utils.get_symbol_rets('SPY')
pf.plotting.show_perf_stats(returns, benchmark_rets)
Start date2004-07-01
End date2019-07-30
Total months180
Backtest
Annual return 17.7%
Cumulative returns 1068.2%
Annual volatility 15.9%
Sharpe ratio 1.10
Calmar ratio 0.83
Stability 0.98
Max drawdown -21.3%
Omega ratio 1.21
Sortino ratio 1.57
Skew -0.43
Kurtosis 1.96
Tail ratio 1.00
Daily value at risk -1.9%
Alpha 0.16
Beta 0.15
In [ ]: