simulate_policy
Answers "if I had had this risk rule in place, which of my trades would it have blocked, and what would that have done to my PnL?".
It takes a risk policy - written in plain English, passed in already compiled, or
your currently active one - and applies it to the trades YOU actually closed. It
reports which ones would have been rejected, by which rule, and the PnL difference.
Runs in the background: the call returns a `job_ref`, and `get_job_status(job_ref)`
returns the result.
Two honesty limits are always reported in `assumptions`:
- Rules that depend on account state at the moment of the order (open position count,
daily loss so far, balance) are evaluated with zeros, because that state cannot be
reconstructed from closed trades. Those rules are UNDER-counted, never over-counted.
- PnL comes from your recorded realised results; it is not re-simulated. If your
trades settled in more than one currency, totals are reported per currency and are
NOT added together.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "simulate_policy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | How far back to look, in days (1-365). Only trades you actually CLOSED in this window are evaluated. | |
| rules | No | An already-compiled rules object (the output of compile_policy). Use this instead of policy_text when you want to test an exact rule set. | |
| policy_text | No | The risk policy in plain English, e.g. 'never trade DOGE, never use more than 10x, always require a stop-loss'. Leave empty to test the policy you already have active. |