We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b47a9d commit 81da123Copy full SHA for 81da123
1 file changed
decision_mapper.py
@@ -141,6 +141,11 @@ def map_strategy_decision(
141
platform_id=IBKR_PLATFORM,
142
).profile
143
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"])
149
risk_flags = tuple(str(flag) for flag in decision.risk_flags)
150
no_execute = bool(_NO_EXECUTE_FLAGS & set(risk_flags))
151
total_equity_value = runtime_metadata.get("portfolio_total_equity")
0 commit comments