Pre-trade compliance and risk check
pre_trade_checkRun an order past a compliance officer and risk manager before sending it to the broker. Checks buying power, cash-account settlement violations, FINRA intraday margin (post-PDT) or legacy PDT limits, Reg SHO short-sale rules, wash-sale exposure, position concentration, per-trade risk versus stop, liquidity, spread, fat-finger prices, leverage and market hours. Returns approve / approve_with_warnings / reject with reasons and a resized quantity when useful. Price: $0.005.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"order": {
"side": "buy",
"symbol": "AAPL",
"quantity": 50,
"limit_price": 200,
"stop_loss_price": 190
},
"market": {
"ask": 200.02,
"bid": 199.98,
"last_price": 200,
"avg_daily_volume": 50000000
},
"account": {
"type": "margin",
"equity": 100000,
"positions": []
}
},
"name": "pre_trade_check"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order | Yes | ||
| market | No | ||
| policy | No | Override risk limits. Defaults: {"max_position_pct":0.2,"max_order_risk_pct":0.02,"max_adv_pct":0.05,"max_spread_pct":0.01,"max_gross_leverage":2,"max_limit_deviation_pct":0.1,"allow_short":true,"allow_extended_hours":false,"require_stop":false} | |
| account | Yes | Account state before the order. | |
| api_key | No | Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial. |