Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Alphalens - is it possible to chart cumulative long short strategy with n day returns?

Hello all

The following generates (amongst other charts) a chart of the cumulative 1 day returns for a factor weighted long short portfolio.

from alphalens.tears import create_full_tear_sheet

create_returns_tear_sheet(factor_data) ```

The IC decay is a wonderful way to pinpoint which best performing period to hold positions - but woud be great to be able to then chart those returns (for instance if the optimal length was 5 days).

And a second question - why not have a competition to find the highest IC for the last 15 years?

Just out of interest, what would you expect that IC (the best for the last 15 years) to be in the range of? Maybe 0.05 to 0.2?

1 response

Found the answers here:
https://github.com/quantopian/alphalens/blob/master/alphalens/examples/alphalens_tutorial_on_quantopian.ipynb

Specifically you can use the following to create cumulative returns for whatever period you like:

al.tears.create_event_returns_tear_sheet(factor_data, prices,  
                                         avgretplot=(5, 15),  #<--enter you desired period here  
                                         long_short=True,  
                                         group_neutral=False,  
                                         std_bar=True,  
                                         by_group=False)