QuantRocket logo

Disclaimer

End-of-Day Analysis with Alphalens

Alphalens is an open-source performance analysis library which pairs well with the Pipeline API. In this notebook we will use Alphalens to analyze whether our momentum factor is predictive of forward returns.

Using Alphalens makes sense when you believe your end-of-day Pipeline rules have alpha. In contrast, if your Pipeline rules simply perform a basic screen and the alpha is entirely provided by your intraday trading rules, it might make more sense to omit this step.

Let's re-run our pipeline from the previous notebook:

To see if our momentum factor is predictive of forward returns, we use the factor data to request forward returns for the corresponding assets and dates, then format the factor and returns data for use with Alphalens:

Then we create a tear sheet to look at the factor. For a predictive factor, the higher quantiles should perform better than the lower quantiles.


Next Up

Part 4: Intraday Trading Rules