Notebook
In [1]:
# Get backtest object
bt = get_backtest('5989bac564d2a359d3e420e6')
100% Time: 0:00:37|###########################################################|
In [2]:
import pyfolio as pf
import numpy as np
import scipy.stats as st
returns = bt.daily_performance.returns
import pandas as pd
print 'median', np.median(returns)
print 'skew', st.skew(returns)
print pd.Series(returns).describe()
median 0.000471964857462
skew 0.61587197098
count    2019.000000
mean        0.000549
std         0.001596
min        -0.008522
25%        -0.000317
50%         0.000472
75%         0.001393
max         0.012479
Name: returns, dtype: float64
In [5]:
bt.create_full_tear_sheet(estimate_intraday=True, slippage=0)
Entire data start date: 2007-08-01
Entire data end date: 2015-08-06


Backtest Months: 96
Performance statistics Backtest
annual_return 0.15
cum_returns_final 2.02
annual_volatility 0.03
sharpe_ratio 5.46
calmar_ratio 7.82
stability_of_timeseries 0.98
max_drawdown -0.02
omega_ratio 2.65
sortino_ratio 10.82
skew 0.62
kurtosis 5.56
tail_ratio 1.71
common_sense_ratio 1.97
gross_leverage 1.00
information_ratio 0.01
alpha 0.14
beta 0.01
Worst drawdown periods net drawdown in % peak date valley date recovery date duration
0 1.89 2009-01-02 2009-01-27 2009-02-13 31
1 1.27 2010-02-23 2010-04-27 2010-05-13 58
2 1.25 2008-10-21 2008-10-30 2008-11-06 13
3 1.16 2008-09-15 2008-09-18 2008-09-22 6
4 1.05 2012-06-11 2012-06-29 2012-08-08 43

[-0.003 -0.005]
Stress Events mean min max
Lehmann 0.10% -0.76% 0.97%
US downgrade/European Debt Crisis 0.05% -0.20% 0.41%
Fukushima 0.08% -0.11% 0.32%
EZB IR Event 0.04% -0.22% 0.17%
Aug07 0.16% -0.18% 1.00%
Mar08 0.09% -0.30% 0.44%
Sept08 0.11% -0.76% 0.97%
2009Q1 0.01% -0.85% 0.47%
2009Q2 0.10% -0.31% 0.65%
Flash Crash 0.13% -0.04% 0.32%
Apr14 0.07% -0.17% 0.24%
Oct14 0.08% -0.12% 0.45%
Low Volatility Bull Market 0.35% 0.35% 0.35%
GFC Crash 0.09% -0.85% 1.25%
Recovery 0.05% -0.41% 0.55%
New Normal 0.04% -0.31% 0.45%