run_guardrail
Validates orders by running a 6-gate guardrail chain including VIX, daily-loss, and risk/reward checks. Returns approved only if all gates pass. Use before every order execution.
Instructions
Run the GUARDRAIL pre-flight middleware chain before placing any order. Executes 6 gates: VIX, daily-loss, stoploss-guard, cooldown, confidence, R/R. Returns approved=true only if all gates pass. Wire this before every order execution.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vix | No | Current VIX (reads CURRENT_VIX env if omitted) | |
| side | Yes | ||
| stop | No | Stop loss price (enables R/R gate) | |
| entry | No | Entry price (enables R/R gate) | |
| gates | No | Gate subset to run. Omit for all: vix, daily_loss, stoploss_guard, cooldown, confidence, risk_reward | |
| symbol | Yes | e.g. MNQ, CL, BTC/USD | |
| daily_pnl | No | Today realized P&L (reads TODAY_REALIZED_PNL env if omitted) | |
| confidence | No | Model confidence 0-1 |