Backtesting & results
Risk policy
Optional rails on the account — exposure caps, drawdown stops, a daily loss limit, a cash reserve, margin-ratio limits, and compounding. What each one does, and how to read what it did to your backtest.
Updated 2026-09-19·Rev. 2026.09
A risk policy is a set of rails you put on the account: how much exposure it may carry, how far it may fall before it slows down or stops, and how much it may lose in a day. Your strategy decides when to trade. The policy decides how much of that the account allows.
Set it in Backtest settings → Risk policy. Rails are off by default. Liquidation and funding aren't rails: they always apply, with or without a policy (see margin, liquidation, and funding).
Presets
Pick a preset, or choose Custom and set each rail yourself. Customize opens the individual fields. Leave a field empty to turn that rail off.
| Conservative | Balanced | Aggressive | |
|---|---|---|---|
| Max gross leverage | 2× | 3× | 5× |
| Max per symbol | 100% | 150% | 300% |
| Soft drawdown (entries × 0.5) | 10% | 15% | 25% |
| Recover within | 3% | 5% | 8% |
| Hard drawdown | 20% | 30% | 45% |
| Daily loss | 3% | 5% | 10% |
| Cash reserve | 20% | 10% | 5% |
| Margin ratio: warn at / exits only at | 40% / 60% | 50% / 70% | 60% / 80% |
Off has no rails. Compounding is a separate switch, and choosing a preset never changes it.
What each rail does
Drawdown is measured from the peak: the highest equity the account has reached so far. Equity is your cash plus the unrealized profit or loss of open positions.
Exposure
Caps on what a new entry may add. An entry that would go past a cap is downsized to fit. If even the exchange's minimum order won't fit, it's refused.
| Rail | Measures |
|---|---|
| Max gross leverage | Total position size ÷ equity. |
| Net exposure band | (Long − short) ÷ equity, between a minimum and a maximum. Longs are capped by the maximum, shorts by the minimum. |
| Max per symbol | One symbol's total position size ÷ equity. This matters most in a portfolio, where several legs can trade the same symbol. |
Drawdown from peak
| Rail | Effect |
|---|---|
| Soft drawdown | Once equity falls this far below the peak, Then either Size down (every new entry × the Entry size × value, so 0.5 halves it) or Exits only (new entries refused). It releases once equity is back within Recover within of the peak. |
| Hard drawdown | Closes every position at the next bar's open and stops trading for the rest of the run. |
Daily loss, cash reserve, margin ratio
| Rail | Effect |
|---|---|
| Daily loss: Loss % of the day's opening equity, or a Loss amount in the account currency | Once either limit is hit, the account is exits-only for the rest of the UTC day. |
| Cash reserve: Keep free | A share of the margin balance that no entry may use. |
| Margin ratio: Warn at | Maintenance margin ÷ margin balance. Crossing it logs a warning and trading continues. 100% is liquidation. |
| Margin ratio: Exits only at | While the ratio is at or above this level, new entries are refused. |
In every exits-only state, your exits, stops, take-profits, and liquidation keep working. Only new entries stop.
The four states
The account is always in one state. When more than one rail is engaged, the strictest one wins.
| State | Meaning | Entered when | Leaves when |
|---|---|---|---|
| Active | Trading normally | Default | — |
| Reduced | Entries sized down | Soft drawdown with Size down | Equity is back within Recover within of the peak |
| Reduce-only | Exits only | Soft drawdown with Exits only, the daily loss limit, or the margin ratio at Exits only at | The trigger clears (for daily loss, the next UTC day) |
| Halted | Flattened, no more trading | Hard drawdown | Never, within a backtest |
Timing
Every rail is decided at a candle close and acts from the strategy's next decision. It's the same rule in quick runs, deep runs, and paper bots, so each one reaches the same decisions from the same closes.
A hard drawdown closes every position at the next bar's open. The trade log shows those exits as Risk halt. Nothing trades after that. The rest of the equity curve is flat by design, not because the market went quiet.
Compounding
Turn on Compounding to grow and shrink fixed-size entries with the account. It scales Fixed qty and Cash/trade sizing by settled cash ÷ starting capital:
- Re-read: how often the scale is updated: Bar, Daily, Weekly or Monthly.
- Min scale (0–1): the floor after losses. Max scale (1–100): the ceiling after gains.
% equity sizing already follows the account, so compounding never applies to it twice.
When several things shape an entry, they apply in this order. First the strategy's size is multiplied by the compounding scale and the soft-drawdown scale. Then the exposure caps and the cash reserve trim it, and the tightest cap names the reason.
Reading what the rails did
- The Risk policy metric. A run with a policy shows a Risk policy cell in More metrics (and the deep-run metrics grid). It gives the state the account ended in, then a line such as "DD 12.4% · 3 downsized · 2 refused": the deepest fall from the peak, and how many entries the rails downsized or refused. A halted run reads red.
- A halt notice. A halted run raises "Hard drawdown halted this run on …; nothing traded after" on the Backtest panel header.
- Refused entries. A quick run's notice counts entries refused by the risk policy separately from orders the exchange rejected. Each row names its rail, for example "Risk policy · Daily loss: Today's loss limit was reached; entries resume the next UTC day".
- Portfolios get a full Risk panel: time spent in each state, gross leverage and net exposure, the peak margin ratio, downsized and refused entries by reason, every state change with its value against the threshold, and each leg's outcome. See portfolios.
Backtest with the rails you'll trade with
A deployed bot enforces its policy exactly as the backtest did. A backtest run without the policy isn't the run your bot will make.
In paper trading
When you deploy, the bot takes the same policy and enforces it at each candle close, the same way the backtest did. The one difference is the halt. A backtest stays halted, while a halted bot is flattened and stopped, and you can start it again to resume. See deploy a bot.
Next: the Edge Report.