Hi Everyone,
As I'm new to Python and Quantopian, I decided to try making an algorithm to try to find optimal portfolio weights to maximize Alpha.
I realize there are problems with the practicality of using a scheme like this, but am just trying to get used to using Python.
The code seems to be doing just what it should in finding the appropriate portfolio weights (based on looking at the backtest logs), but right at the end when I try to order_target_percent securities (which I have commented out for now) based on those weights, I get the error:
110 Error Runtime exception: ValueError: cannot convert float NaN to integer.
First, I don't understand why it would need to convert to an integer if I want to input a decimal/percent.
Second, when I test the values with isnan() it returns false.
Does anyone know what I'm missing?
Thanks very much!