Back to Community
Alphalens weekly factors

I currently have a signal which applies to a large basket of stocks, and I have gotten Alphalens to work as intended for a daily time period.

However, my belief is that this particular signal is more predictive over a week-week timeframe. I have tried to test this by resampling my prices, prices.resample("W").last(), and likewise with my raw factors (stacking to get it in the right format for AlphaLens) factors.resample("W").last().stack(). I then want to produce a tearsheet that examines performance 1 week, 1 month, and 1 quarter in advance.

get_clean_factor_and_forward_returns(  
    factor_weekly,  
    prices_weekly,  
    quantiles=5,  
    periods=(1, 4, 12),   # 1 week, 1 month, 1 quarter  
    filter_zscore=None)  

This runs fine, and seems to confirm my hypothesis that the factor is more predictive on a weekly horizon (higher and more robust IC).

I wonder if anyone could confirm whether I am interacting with AlphaLens in the correct way. I read somewhere that AlphaLens is agnostic to the time-period as long as the factor and price series align (which they do), but one of my causes for concern is the following table:

    1D  4D  12D  
Ann. alpha  1.784   0.337   0.167  
beta    0.312   0.259   0.076  
Mean Period Wise Return Top Quantile (bps)  42.465  12.156  3.484  
Mean Period Wise Return Bottom Quantile (bps)   -48.463 -16.652 -9.072  
Mean Period Wise Spread (bps)   90.928  28.475  12.336  

We can see that the headers are 1D, 4D and 12D. Is this a "typo" from AlphaLens and actually the "D" just means whatever period I'm using?

Thanks!

1 response

I'm confused with this too. Have you figured it out? Thank you!