Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
No objects to concatenate,using alaphalens to analysing my own factor

Hi, guys,
I learned the example in the lecture and I am trying to use alapha lens to test my factor. However, I got an error "No objets to concatenate", could someone point our where I am wrong?

Best.
Thank you

6 responses

You get that error when there is no data. it is probably because you are not providing the price data:

pricing=get_pricing(assets,start_date='2017-08-25', end_date='2017-08-27',fields='open_price')  

I guess the start_date should be 2016-08-25

Thank you, Luca,
I changed the date to 2016-08-25, and then I got error, Bin edges must be unique: array([ 0., 0., 0., 0., 0., 0.])
My factor is boolean value, 0 or 1. Is that mean I cannot analyse this kind of alpha?
Best

When you have a factor with discrete values in your (case 0 and 1) you can use 'bins' option providing custom ranges.In your example: bins=[-0.5,05,1.5]. That will create 2 bins, one in the range -0.5 to 0.5 (all the 0s will fall there) and a second one in the range 0.5 to 1.5 (all the 1s will fall there).

Have a look here how I used bins option with discrete values.

Hi Luca,
As you suggested, I changed bins to [-0.5,0.5,1.5], but it doesn't work. I am attaching my notebook here.

You also have to set quantiles=None otherwise the bins option won't be used