Notebook
In [17]:
bt = get_backtest("59fb5fd5e5960144e0a17b6d")
100% Time: 0:00:06|###########################################################|
In [18]:
bt.create_perf_attrib_tear_sheet()
Summary Statistics
Annualized Specific Return 0.073426
Annualized Common Return -0.002804
Annualized Total Return 0.070703
Specific Sharpe Ratio 0.890514
Exposures Summary Average Risk Factor Exposure Annualized Return Cumulative Return
basic_materials -0.026562 -0.003301 -0.033029
consumer_cyclical -0.019324 -0.006224 -0.061459
financial_services 0.080744 0.012525 0.134787
real_estate -0.033051 -0.009159 -0.089233
consumer_defensive -0.031425 -0.001421 -0.014343
health_care 0.051404 0.008788 0.092960
utilities -0.122725 -0.015394 -0.145806
communication_services 0.001326 -0.000124 -0.001257
energy 0.038651 0.005889 0.061468
industrials -0.064510 -0.007933 -0.077724
technology 0.093940 0.015258 0.166289
momentum -0.022491 -0.003783 -0.037772
size 0.045428 -0.001258 -0.012710
value 0.173145 0.001745 0.017870
short_term_reversal -0.055719 -0.003165 -0.031689
volatility -0.215898 0.003442 0.035524

Summary Statistics - This table provides the annualized returns breakdown over the entire backtest, as well as a Sharpe ratio derived from the specific returns of the backtest.

Exposures Summary - This table gives us the average exposure of our algorithm to each risk factor. It also gives us the annualized and cumulative returns that are explained by each one of these risk factors.

Time Series of Cumulative Returns - This plot breaks down the results of our backtest into cumulative specific and common returns. Common returns are the portion of our backtest's returns that are attributed to common risk factors. Specific returns are the residual, and is what we commonly refer to as alpha.

Daily Returns Attribution - This plot attributes the daily returns to each of the common risk factors. It also includes daily specific returns.

Daily Risk Factor Exposures - This plot shows the daily exposures to each common risk factor.

In [10]:
import numpy as np
import pandas as pd

Check the Absolute Mean of the Exposures

This tells us how much time the exposure spends away from 0. If the exposure changes regimes and spends time well above and/or well below 0.

In [19]:
np.abs(bt.factor_exposures).mean()
Out[19]:
basic_materials           0.068975
consumer_cyclical         0.114839
financial_services        0.082189
real_estate               0.076385
consumer_defensive        0.067034
health_care               0.051404
utilities                 0.123899
communication_services    0.004324
energy                    0.040774
industrials               0.129805
technology                0.093940
momentum                  0.205814
size                      0.155249
value                     0.288784
short_term_reversal       0.210400
volatility                0.310628
dtype: float64

Seems like the algo has fairly high exposures to both sectors and style factors. We'll plot the highest exposure factor to see how it looks.

In [22]:
bt.factor_exposures['volatility'].plot();

Next Steps

The next step would be to decide if you want to control you risk more. In general lower risk is better, but if you try to overconstrain you model you may wash out all the alpha you have. Good next steps would be:

  1. See if your model can be adjusted to avoid these exposures.
  2. Constrain your risk in your portfolio optimization step, as discussed in this lecture: https://www.quantopian.com/lectures/risk-constrained-portfolio-optimization