You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ONLY APPLIES TO BACKTESTING
When you unsubscribe from a ticker, although it is removed from the tickers_data and tickers list, it is not removed from the generator. Additionally, if you subscribe to a new ticker mid backtest, the ticker data isnt added to the generator.
so when you hit:
def stream_next_tick:
index, row = next(self.tick_stream) # The generator
You will actually still get the data for the ticker that was removed. This then assigns the removed ticker to ticker = row["ticker"]. Furthermore, when you try and access self.tickers[ticker]["bid"] you get a key error because the key no longer exist in the updated self.ticker dict.
I'm not sure how this can be solved because if you reassign the generator the new data frame that contains the updated ticker list (and data), you reset the generator (correct?).
I'm not sure if i'm explaining this clearly, but if you have any questions on the issue, ill try my best to articulate better.
The text was updated successfully, but these errors were encountered:
ONLY APPLIES TO BACKTESTING
When you unsubscribe from a ticker, although it is removed from the tickers_data and tickers list, it is not removed from the generator. Additionally, if you subscribe to a new ticker mid backtest, the ticker data isnt added to the generator.
so when you hit:
def stream_next_tick:
index, row = next(self.tick_stream) # The generator
You will actually still get the data for the ticker that was removed. This then assigns the removed ticker to ticker = row["ticker"]. Furthermore, when you try and access self.tickers[ticker]["bid"] you get a key error because the key no longer exist in the updated self.ticker dict.
I'm not sure how this can be solved because if you reassign the generator the new data frame that contains the updated ticker list (and data), you reset the generator (correct?).
I'm not sure if i'm explaining this clearly, but if you have any questions on the issue, ill try my best to articulate better.
The text was updated successfully, but these errors were encountered: