Can someone show me best way to pass variables from my "alpha" model to my "exec" model
I was taking the approach of
in main class __init__ file
declaring the variable with a default value
self.spread = None
then in the Update function of my Alpha model , which has a reference to the calling file as "algorithm", setting this
variable as such
def Update(self, algorithm, data):
for security in algorithm.Securities:
if self.DataEventOccured(data, security.Key):
insights = []
return insights
algorithm.spread = self.pair[1].Price - self.pair[0].Price
When I use the debugger code to iterate through the program , it recognizes "algorithm.spread" as the correct value of the difference of these two pairs, but when it has completed the AlphaModel and I try to reference the variable using "self.spread" I go back to the intially assined default "None" value.
What should I be doing differently?
Thanks