Hey guys! 

I have what will be a simple question for anyone well endowed in Python! I am attempting to loop through multiple symbols but I keep getting these errors!


Runtime Error: 'bool' object is not subscriptable
  at OnData
    if (symbol_price < self.trigger_thirty_min_low[symbol]) and self.invest_thirty_min[symbol] and self.thirty_min_trigger[symbol] and not self.Portfolio.Invested[symbol]:
   at Python.Runtime.PythonException.ThrowLastAsClrException()

OR 

argument of type ‘bool’ is not iterable


Consider the following example code in an OnData Method: 

for symbol in self.symbolData.keys():

  symboldata = self.symbolData[symbol]

  if symboldata.IsReady():

    if self.short[symbol] and self.target_sell[symbol] and (symbol_price < self.initial_target_price[symbol]):

    self.MarketOrder(self.ticket.Symbol, (self.Securities[self.ticket.Symbol].Holdings.AbsoluteQuantity))

    self.target_sell[symbol] = False

    self.thirty_min_reversal_sell[symbol] = False

    self.Log(f'{symbol} EXIT (INITIAL TARGET) {symbol_price}')

    if self.long[symbol] and self.target_sell_l[symbol] and (symbol_price <   self.initial_target_price_l[symbol]):

    self.MarketOrder(symbol, -(held_stocks))

    self.target_sell_l[symbol] = False

    self.thirty_min_reversal_sell_l[symbol] = False

    self.Log(f'{symbol} EXIT (INITIAL TARGET) {symbol_price}')


 

Thank you so much to anyone who helps me out! 

Best, 

Jesse

Thank you my awesome community!

Author