def check_stop_loss_positions(self, risk_manager) -> List[str]: """ Scan all open positions for stop-loss violations. Returns list of tickers that have exceeded MAX_LOSS_PER_POSITION. Caller should force-close these positions immediately. Args: risk_manager: GlobalRiskManager instance to check limits Returns: List of ticker symbols that need force-close """ stop_loss_triggered = [] for ticker, pos in self._positions.items(): if pos.side == "FLAT": continue unrealized = pos.unrealized_pnl() realized = pos.realized_pnl # Check if this position exceeds stop-loss allowed, reason = risk_manager.check_position_loss( ticker=ticker, current_unrealized_pnl=unrealized, current_realized_pnl=realized ) if not allowed: stop_loss_triggered.append(ticker) logger.critical( f"[POS] STOP-LOSS: {ticker} triggered — " f"realized=${realized:.2f} unrealized=${unrealized:.2f} total=${realized + unrealized:.2f}" ) return stop_loss_triggered