Hey guys,

I get the following error for my code: 
Trying to dynamically access a method that does not exist throws a TypeError exception. To prevent the exception, ensure each parameter type matches those required by the 'NoneType'>) method. Please checkout the API documentation

I went through the code step by step and the error occurs due to introducing a few lines of code that update the stop market order price of a bought stock whenever the price goes up (or at least, the program doesn't have any errors when I leave these lines of code that provide the trailing mechanism out). It doesn't immediately give an error, only the next time the OnData tries to access the Data.keys() object for the symbol that has just received a StopMarketOrder update! I suspect something is going wrong with inserting the tickets of the StopMarketOrders into a dictionary, which I use to update the limit price later on as well. I can't seem to figure out what exactly is going wrong here, would anyone have any idea how to solve this dynamic accessing issue? I have commented the code in line 170 because I couldn't upload  the erroneous backtest.

 

NewPrice = self.CurrentPrice[symbol] * (1 - self.StopPercentage)
response = self.StopLossOrder[symbol].UpdateLimitPrice(NewPrice, symbol)

Thank you in advance!