Volume & risk
How much you risk per trade and when the engine refuses to take new trades.
Volume sizing
Two modes are available in the basic form.
Fixed lot
Every trade uses the same lot size. The simplest possible setup.
{ "mode": "fixed", "lot": 0.1 }
Use this when you want to compare strategies on a level playing field, or when your account is small and constant.
Linear after loss
A "martingale lite" approach: increase the lot after each losing trade, reset after a win or breakeven.
{
"mode": "linear_after_loss",
"base_lot": 0.1,
"step": 0.05,
"max_lot": 1.0,
"reset_when": "breakeven_or_win"
}
- base_lot — the starting lot
- step — how much to add after each loss (
0.1 → 0.15 → 0.20 → …) - max_lot — hard ceiling, never exceed this even on a long losing streak
Use sparingly. Linear-after-loss can recover small drawdowns quickly but turns a losing streak into a catastrophic one. Always pair it with a strict kill switch.
Kill switch
A safety net that halts new entries when risk thresholds are breached. The currently open trade is allowed to resolve naturally; nothing new opens after the trip until the run ends.
Three configurable triggers (all optional — leave blank to disable):
Max daily loss
Halt if the day's net PnL drops below −X dollars.
"max_daily_loss": 200
Resets at the start of each trading day.
Max drawdown percent
Halt if equity drops more than X% below its peak since the run started.
"max_drawdown_percent": 15
This is the most important guardrail. A 15% drawdown means losing 15 cents for every dollar of peak equity — easy to recover from. A 50% drawdown requires a 100% gain to break even.
Max loss streak
Halt after N losing trades in a row.
"max_loss_streak": 5
Useful for catching a market regime change — five losses in a row means your edge has likely evaporated for now.
Pause after loss (transient)
Distinct from the sticky "halt" above: after every losing trade, the engine can refuse new entries for a short window. Configured in the manifest's kill_switch block.
How the engine reports a kill-switch trip
In the run result you'll see:
kill_switch_tripped: truekill_switch_reason: "max_drawdown 16.2% > 15%"
The chart shades the post-trip region grey so you can see exactly where the run effectively ended.
A reasonable starting set
For a new strategy:
{
"max_daily_loss": 200, // = 2% of $10,000
"max_drawdown_percent": 15,
"max_loss_streak": 5
}
Tighten as you gain confidence. A polished, ready-for-forward-test strategy might run with max_drawdown_percent: 8.