Hello,
can I call an attribute initialized in the QCAlgorithmFramework class in other modules?
I initialize
class MyFrameworkAlgorithm(QCAlgorithmFramework):
def Initialize(self):
self.symbolDataBySymbol = {}
then I want to call this symbolDataBySymbol dictionary in Alpha and Execution.
When I do something like
class MyAlpha(AlphaModel):
def Update(self, algorithm, data):
symbolData = SymbolData()
algorithm.symbolDataBySymbol[symbol] = symbolData
class SymbolData:
'''Contains data specific to a symbol required by this model'''
I get
Runtime Error: AttributeError : 'QCAlgorithmFramework' object has no attribute 'symbolDataBySymbol' AttributeError : 'QCAlgorithmFramework' object has no attribute 'symbolDataBySymbol'
Why do I want to do that for now? When I get a Alpha signal, I want to determine the stop-order price, store it in SymbolData instance and use it in Execution module by calling algorithm.symbolDataBySymbol[symbol].enrty_price
I saw that in the github examples of Alpha and Execution models that SymbolData class approach is used. The examples are not complete algorithms but only showing the specific module. I figured it would be useful if I can use one SymbolData instance to be used all modules.
Best,
Atacan