I get Alphalens errors in the attached example. The example uses StockTwits factors, but I get similar error with other factors.
Any thoughts?
I get Alphalens errors in the attached example. The example uses StockTwits factors, but I get similar error with other factors.
Any thoughts?
It seems
get_clean_factor_and_forward_returns
is not able to compute the quantiles for most of your data. Try passing max_loss=0
to the function to see what kind of exception is raised during the computation.
I suspect (I haven't checked) that the factor doesn't have data for most of the stocks ( QTradableStocksUS is quite big) so it defaults to some value. This means most of the stocks will have the same value and this would explain why the function fails (see here).
The easy solution is to use a smaller universe (e.e. Q500US) where most of the stock data is populated. Otherwise you could identify this default value used by psychsignal and remove those entries before passing the factor to Alphalens