Notebook

W_10 Custom ATR Threshold Timed W_10 Plus Bonds

In [3]:
import pyfolio as pf
import matplotlib.pyplot as plt
import empyrical  as ep
In [4]:
bt = get_backtest('5d5c68637b5f2360f090d554')
returns = bt.daily_performance['returns']
100% Time:  0:03:12|##########################################################|
In [5]:
cum_returns = ep.cum_returns(returns)
ax = cum_returns.plot(figsize=(14,5))
ax.set(title='Cumulative Returns', ylabel='returns', xlabel='date');
In [6]:
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.5%
Cumulative returns 1034.7%
Annual volatility 15.9%
Sharpe ratio 1.09
Calmar ratio 0.82
Stability 0.98
Max drawdown -21.3%
Omega ratio 1.20
Sortino ratio 1.55
Skew -0.43
Kurtosis 1.95
Tail ratio 1.01
Daily value at risk -1.9%
Alpha 0.16
Beta 0.15
In [7]:
fig = plt.figure(1)
plt.subplot(1,3,1)
pf.plot_annual_returns(returns)
plt.subplot(1,3,2)
pf.plot_monthly_returns_dist(returns)
plt.subplot(1,3,3)
pf.plot_monthly_returns_heatmap(returns)
plt.tight_layout()
fig.set_size_inches(15,5)
In [8]:
ax = bt.recorded_vars.plot(figsize=(14,5))
ax.set(title='W_10 Custom ATR Threshold', ylabel='value', xlabel='date');
In [ ]: