def on_data(self, data: Slice): self._latest_slice = data if self._active_straddle is None or self._equity_symbol not in data: return spy_price = data[self._equity_symbol].price if spy_price is None or spy_price <= 0: self.debug("[EXIT] No valid SPY price in this slice, skipping exit logic.") return self._check_exit_logic(spy_price) def _check_exit_logic(self, spy_price) -> None: if self._straddle_entry_price <= 0: self.debug("[_CHECK_EXIT_LOGIC] Early exit – invalid straddle_entry_price") return pct_move = (spy_price - self._straddle_entry_price) / self._straddle_entry_price self.debug(f"[EVAL] {self.time} Δ={pct_move:.4%} entry={self._straddle_entry_price:.2f}") self.debug( f"[_CHECK_EXIT_LOGIC][{'LIVE' if self.live_mode else 'BT'}] time={self.time} " f"SPY={spy_price:.4f}, straddle_entry={self._straddle_entry_price:.4f}, " f"pct_move={pct_move:.6f}" )

 

When back testing it is working just fine but when live deploy, SPY price is getting stuck at a single price. For eg, if it recorded 625 then code is using 625 every second and not changing and hence pct move will also be zero and code will not trigger any exit logic. What am i doing wrong here. I use IBKR and i have also subscribed to data L1 and L2. 

thank you in advance