Notebook
In [ ]:
 Quality Companies in an Uptrend, order_optimal_portfolio by Dan Whitnable 
In [1]:
import pyfolio as pf
import matplotlib.pyplot as plt
import empyrical  as ep
In [2]:
bt = get_backtest('5de30f198d71cb4c3d3e2a9f')
returns = bt.daily_performance['returns']
100% Time:  0:00:09|##########################################################|
In [3]:
cum_returns = ep.cum_returns(returns)
ax = cum_returns.plot(figsize=(14,5))
ax.set(title='Cumulative Returns', ylabel='returns', xlabel='date');
In [4]:
benchmark_rets = pf.utils.get_symbol_rets('SPY')
pf.plotting.show_perf_stats(returns, benchmark_rets)
Start date2003-01-02
End date2019-11-18
Total months202
Backtest
Annual return 18.8%
Cumulative returns 1728.7%
Annual volatility 15.2%
Sharpe ratio 1.21
Calmar ratio 1.01
Stability 0.98
Max drawdown -18.7%
Omega ratio 1.23
Sortino ratio 1.71
Skew -0.45
Kurtosis 2.67
Tail ratio 0.99
Daily value at risk -1.8%
Alpha 0.13
Beta 0.51
In [6]:
ax = bt.recorded_vars.plot(figsize=(14,5))
ax.set(title='Long-Short Count and TF Check', xlabel='date');
In [ ]: