Hi

I'm very new to QuantConnect. 

I have created attached backtest.

For context, the intention of the algorithm is to score all the members of the QC500 universe with a momentum score based on linear regression then trade the top 30 stocks long if the score is over 40.

I havent worked out yet how to do it but I want to only trade every 1 week for new insights and to rebalance by risk parity and monthly for changes in QC500(which I believe is the default update period for QC500 anyway).

I get the above error (Runtime Error: Cannot implicitly convert type 'Python.Runtime.PyObject' to 'decimal' in PythonIndicator.cs:line 144), which is being caused by self.Value in the custom indicator. 

I know this because if I change the variable name to self.Score, it doesnt error and runs through. Anyone have any idea how I can use the intended self.Value without creating the error.

Also any help implementing my intended timing of rebalancing would be appreciated

 

(The attached backtest uses the self.Score version as I cant attach a failed backtest with the self.Value being updated.)

Thanks for any help.

Mark