INNER CODE UNIT · Python
_forward_local_exit_request
qrak/LLM_trader · src/app.py:404
async def _forward_local_exit_request(self) -> str | None:
"""Forward a CLOSE the local SL/TP monitor requested to the executor.
The monitor can detect that the bracket was reached but it cannot close the
trade on the exchange, and a ticker price is not a fill — so the only thing
this does is hand the already-recorded intent to the executor. With no
executor handler (or no queued recommendation) nothing is sent: the intent
stays pending/unknown, the local position stays, and never a local close at
the ticker price.
Returns the resulting intent state, or None when there was nothing to send.
"""
if self.executor_handler is None:
return None
taker = getattr(self.trading_strategy, "take_pending_local_close_decision", None)
if not callable(taker):
return None
try: