Skip to content

Commit 81da123

Browse files
Pigbibiclaudecursoragent
committed
feat(decision_mapper): forward unrealized PnL diagnostics into decision
Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 3b47a9d commit 81da123

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

decision_mapper.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ def map_strategy_decision(
141141
platform_id=IBKR_PLATFORM,
142142
).profile
143143
diagnostics = dict(decision.diagnostics)
144+
# Platform-computed risk inputs for QPK apply_risk_gate / stop-loss checks.
145+
if runtime_metadata.get("unrealized_pnl_pct") is not None:
146+
diagnostics["unrealized_pnl_pct"] = float(runtime_metadata["unrealized_pnl_pct"])
147+
if runtime_metadata.get("consecutive_losses") is not None:
148+
diagnostics["consecutive_losses"] = int(runtime_metadata["consecutive_losses"])
144149
risk_flags = tuple(str(flag) for flag in decision.risk_flags)
145150
no_execute = bool(_NO_EXECUTE_FLAGS & set(risk_flags))
146151
total_equity_value = runtime_metadata.get("portfolio_total_equity")

0 commit comments

Comments
 (0)