Notebook

Load a backtest containing an in sample period through the live trading period

In [13]:
in_out_sample = get_backtest("56ba1fe7a8f4861197a211e8")
100% Time: 0:00:02|###########################################################|
In [14]:
in_out_sample.create_full_tear_sheet(live_start_date="2015-08-06", bayesian=True)
Entire data start date: 2015-01-02
Entire data end date: 2016-02-08


Out-of-Sample Months: 6
Backtest Months: 7
                   Backtest  Out_of_Sample  All_History
annual_return          0.31           0.26         0.30
annual_volatility      0.07           0.16         0.12
sharpe_ratio           3.72           1.56         2.22
calmar_ratio          13.61           3.68         4.15
stability              0.95           0.47         0.93
max_drawdown          -0.02          -0.07        -0.07
omega_ratio            1.89           1.35         1.54
sortino_ratio          6.15           2.29         3.35
skewness              -0.16          -0.31        -0.37
kurtosis               1.22           5.25         8.65
information_ratio      0.11           0.14         0.13
alpha                  0.27            NaN          NaN
beta                   0.09            NaN          NaN

Worst Drawdown Periods
   net drawdown in %  peak date valley date recovery date duration
0               7.14 2015-11-09  2015-12-14           NaT      NaN
1               4.60 2015-09-24  2015-09-28    2015-10-02        7
2               4.28 2015-08-18  2015-08-24    2015-08-27        8
4               2.31 2015-04-24  2015-05-06    2015-05-14       15
3               2.12 2015-10-16  2015-10-27    2015-11-05       15


2-sigma returns daily    -0.014
2-sigma returns weekly   -0.021
dtype: float64
Stress Events
             mean    min    max
Fall2015    0.002 -0.043  0.032
New Normal  0.001 -0.043  0.040

Top 10 long positions of all time (and max%)
[u'BHI' u'TWC' u'XLE' u'XLY' u'SYY' u'VIPS' u'HUM' u'TRV' u'UNP' u'AMT']
[ 0.719  0.707  0.689  0.607  0.523  0.507  0.49   0.287  0.28   0.236]


Top 10 short positions of all time (and max%)
[u'XLY' u'KEY' u'TWC' u'XLE' u'VIPS' u'BHI' u'TRV' u'CBS' u'AMT' u'HUM']
[-0.803 -0.664 -0.541 -0.378 -0.343 -0.269 -0.236 -0.214 -0.196 -0.184]


Top 10 positions of all time (and max%)
[u'XLY' u'BHI' u'TWC' u'XLE' u'KEY' u'SYY' u'VIPS' u'HUM' u'TRV' u'UNP']
[ 0.803  0.719  0.707  0.689  0.664  0.523  0.507  0.49   0.287  0.28 ]


All positions ever held
[u'XLY' u'BHI' u'TWC' u'XLE' u'KEY' u'SYY' u'VIPS' u'HUM' u'TRV' u'UNP'
 u'AMT' u'GWW' u'CBS' u'WMT' u'SHPG' u'EXPE' u'PPG' u'SYK' u'LNG' u'POT'
 u'YELP' u'PANW' u'TIF' u'ALXN' u'GIS' u'AIG' u'HD' u'CAM' u'VRTX' u'CHTR'
 u'ILMN' u'FXI' u'XLV' u'AET' u'IWF' u'ORCL' u'YUM' u'UNH' u'ETP' u'KMI'
 u'FEYE' u'ETE' u'COF' u'VTI' u'COH' u'AXP' u'TJX' u'FB' u'BRK_B' u'FAS'
 u'CTL' u'RIO' u'DD' u'MYL' u'CMI' u'SWN' u'ESRX' u'GD' u'EWW' u'EIX'
 u'CAH' u'IJH' u'BSX' u'OXY' u'WMB' u'MNK' u'CRM' u'ZG' u'BBY' u'EXC'
 u'SPXU' u'LEN' u'GILD' u'ADBE' u'ITUB' u'CI' u'UA' u'CB' u'BBD' u'PCP'
 u'DIA' u'KORS' u'JNJ' u'STJ' u'P' u'MCK' u'SSO' u'GE' u'UPRO' u'KRFT'
 u'BP' u'IVV' u'SHW' u'EWZ' u'REGN' u'MA' u'SSYS' u'BEAV' u'MSI' u'KR'
 u'EWJ' u'BIIB' u'SUNE' u'XRT' u'SDS' u'EBAY' u'UAL' u'SDRL' u'SBUX' u'PG'
 u'TSN' u'LMT' u'FOXA' u'AGG' u'ZBH' u'ADP' u'EPD' u'GPRO' u'EWG' u'LBTY_K'
 u'LQD' u'DAL' u'VFC' u'PSX' u'EQIX' u'XLB' u'CELG' u'PXD' u'BDX' u'AAL'
 u'PRGO' u'SYF' u'PH' u'CMCS_A' u'CMCS_K' u'DIS' u'AVGO' u'YHOO' u'EMR'
 u'CMG' u'BIDU' u'NSC' u'AMP' u'GOOG_L' u'CVX' u'OIH' u'GOOG' u'XOM' u'MON'
 u'ETN' u'MMM' u'MTB' u'KSS' u'EWY' u'STZ' u'MAR' u'AMGN' u'UWTI' u'F']
[ 0.803  0.719  0.707  0.689  0.664  0.523  0.507  0.49   0.287  0.28
  0.236  0.234  0.214  0.182  0.18   0.172  0.165  0.159  0.156  0.153
  0.15   0.148  0.142  0.138  0.135  0.134  0.134  0.133  0.128  0.126
  0.125  0.124  0.124  0.119  0.117  0.116  0.116  0.115  0.114  0.112
  0.11   0.109  0.109  0.109  0.108  0.108  0.108  0.106  0.106  0.105
  0.103  0.103  0.102  0.1    0.099  0.098  0.098  0.098  0.097  0.096
  0.095  0.095  0.093  0.093  0.092  0.092  0.092  0.092  0.092  0.091
  0.091  0.091  0.091  0.091  0.09   0.09   0.09   0.09   0.09   0.089
  0.089  0.089  0.088  0.088  0.087  0.087  0.086  0.085  0.084  0.084
  0.083  0.083  0.083  0.082  0.082  0.082  0.081  0.081  0.08   0.08
  0.079  0.079  0.078  0.078  0.078  0.078  0.077  0.077  0.077  0.077
  0.075  0.075  0.073  0.073  0.073  0.073  0.073  0.072  0.071  0.07   0.07
  0.068  0.068  0.067  0.066  0.064  0.064  0.063  0.063  0.062  0.062
  0.061  0.061  0.061  0.06   0.06   0.06   0.058  0.055  0.055  0.053
  0.051  0.051  0.051  0.049  0.049  0.049  0.047  0.046  0.046  0.045
  0.045  0.045  0.042  0.041  0.035  0.029  0.027  0.022]


Running T model
 [-----------------100%-----------------] 2000 of 2000 complete in 3.0 sec
INFO (theano.gof.compilelock): Refreshing lock /home/qexec-restricted/.theano/compiledir_Linux-3.13--generic-x86_64-with-Ubuntu-14.04-trusty-x86_64-2.7.11-64/lock_dir/lock
Finished T model (required 31.23 seconds).

Running BEST model
 [-----------------100%-----------------] 2000 of 2000 complete in 7.8 sec
Finished BEST model (required 45.86 seconds).

Finished plotting Bayesian cone (required 0.18 seconds).

Finished plotting BEST results (required 0.81 seconds).

Finished computing Bayesian predictions (required 0.14 seconds).

Finished plotting Bayesian VaRs estimate (required 0.05 seconds).
/usr/local/lib/python2.7/dist-packages/matplotlib/axes/_axes.py:475: UserWarning: No labelled objects found. Use label='...' kwarg on individual plots.
  warnings.warn("No labelled objects found. "
INFO (theano.gof.compilelock): Refreshing lock /home/qexec-restricted/.theano/compiledir_Linux-3.13--generic-x86_64-with-Ubuntu-14.04-trusty-x86_64-2.7.11-64/lock_dir/lock

Running alpha beta model
 [-----------------100%-----------------] 2000 of 2000 complete in 3.5 sec
Finished running alpha beta model (required 58.42 seconds).

Finished plotting alpha beta model (required 0.16 seconds).

Total runtime was 136.85 seconds.
In [ ]: