trading_risk_gate
Pure-math position risk check — NO AI, NO hallucination possible. Hard-enforces: position size vs max_position_pct, daily P&L vs daily_drawdown_pct, confidence vs threshold. Returns PASS or REJECT with exact mathematical reason. Must be called before every trade proposal. CALL FORMAT: trading_risk_gate({proposed_size_usd: 50, portfolio_value_usd: 2500, daily_pnl_usd: -30, confidence: 0.85, risk: {max_position_pct: 2, daily_drawdown_pct: 5, confidence_threshold: 0.80}})
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| risk | Yes | Risk parameters from your strategy schema. | |
| confidence | Yes | Model confidence 0–1 (e.g. 0.85 = 85%). | |
| daily_pnl_usd | No | P&L so far today in USD (negative = loss). Default: 0. | |
| proposed_size_usd | Yes | Dollar size of the proposed trade. | |
| portfolio_value_usd | Yes | Total portfolio value in USD. |