Hello. In one example I was working with tick data. I set the resolution to tick. As far as I thought, we should have a single event in every tick that enters OnData. But why the following code was used to check the data. That is, how many ticks may we have in each tick event? And for this reason, for has been used.

def OnData(self, data): if not data.ContainsKey(self.symbol): return for tick in data.Ticks[self.symbol]: if tick.TickType == TickType.Trade: self.trade_ticks.append(1) self.quote_ticks.append(0) if tick.TickType == TickType.Quote: self.trade_ticks.append(0) self.quote_ticks.append(1)

Best,
lob.Faidi

Author