Simulation
| Setting | Default | What It Does | How to Optimise |
|---|---|---|---|
| Distribution Type | Normal | Normal uses a standard bell curve. Fat Tails injects extreme moves into \~5% of trades, mimicking black-swan events. Bootstrap resamples your real trade history directly. | Start with Normal. Switch to Fat Tails for volatile instruments. Use Bootstrap if you have 30+ real trades — it's the most realistic option. |
| Simulations | 1000 | Number of independent equity paths. More paths = more stable tail estimates. Capped at \~2000 by Pine Script. | 500 is adequate for most decisions. Push to 1000–2000 for precise ruin rate estimates. Never use 100 for anything consequential. |
| Trades to Forecast | 100 | How many trades each simulation runs. | Match to your cadence — 100 trades is 20 weeks at 5 trades/week. Use 200–300 for longer-term survival assessment. |
Strategy
| Setting | Default | What It Does | How to Optimise |
|---|---|---|---|
| Win Rate (%) | 50% | Percentage of trades that are winners. | Use your actual backtested rate, not your target. Most traders overestimate this. |
| Risk : Reward | 2.0 | Average win size divided by average loss size. | Use your measured R:R. The Kelly Fraction is very sensitive to this input. |
| Position Sizing | Fixed Fractional | Fixed Fractional risks a set % every trade. Half Kelly uses half the theoretically optimal fraction — the standard practical choice. Full Kelly maximises long-run growth but produces extreme drawdowns. | Start at Fixed Fractional 1%. Compare Half Kelly once you're confident in your parameters. Never use Full Kelly with real money. |
| Fixed Risk per Trade (%) | 1.0% | Equity risked per trade in Fixed Fractional mode. Ignored in Kelly modes. | 1% is conservative. Above 3% produces alarming ruin rates on most strategies. |
| Cost per Trade (%) | 0.05% | Commission, spread, and slippage combined. | Be honest — even 0.1%/trade compresses final equity significantly over 100 trades. |
Risk
| Setting | Default | What It Does | How to Optimise |
|---|---|---|---|
| Ruin Threshold (%) | 50% | A path is marked ruined if equity drops below this at any point — even if it recovers. | 50% is a common definition. Lower it to 25% to test for catastrophic ruin; raise it to 70% to test a softer "unacceptable loss" threshold. |
Bootstrap
Bootstrap mode resamples your real trade history rather than generating synthetic returns. This preserves everything specific to your actual results — outlier sizes, the natural rhythm of your equity curve, and the serial structure of your wins and losses.
Paste your trade returns into Trade History as comma-separated decimals: 0.02,-0.01,0.03,-0.015. Each number is the return on that trade as a fraction of risked capital.
Why block resampling matters: naïve bootstrapping picks trades at random one at a time, which destroys streak structure. If you had six consecutive losses in your real history, naïve resampling scatters them across simulations so they never cluster — making the strategy look more stable than it is. Block resampling samples consecutive sequences instead, keeping the natural streak character of your data intact.
| Setting | Default | What It Does | How to Optimise |
|---|---|---|---|
| Block Size | 5 | Trades are resampled in consecutive blocks of this size, preserving streak structure. | A block of 1 treats every trade as independent. Increase toward 10–20 for trend-following systems that go on extended runs. If unsure, compare ruin rates at block sizes 3, 10, and 20 — the sensitivity tells you how much serial structure your history contains. |
| Trade History | (empty) | Your actual trade returns as comma-separated decimals. Leave blank to fall back to Normal. | You need at least 30 trades for meaningful resampling. 50–100 gives reasonable variety; 200+ gives stable tail estimates. |
Regime Switching
Markets alternate between conditions where your strategy works and conditions where it struggles. Regime switching models this by letting each simulation oscillate between a Favourable regime and an Adverse regime, with random transitions at each trade. The critical difference from plain simulation is clustering — losses in an adverse regime group together into the extended drawdown periods that actually destroy accounts, rather than being randomly scattered across the path.
In Normal / Fat Tails mode, you configure regime behaviour manually. In Bootstrap mode, regimes are detected automatically from your trade history: a rolling window identifies which of your historical trades occurred during above-average vs below-average local performance, splits them into two pools, and estimates transition probabilities from the observed frequency of regime changes in your real data.
| Setting | Default | What It Does | How to Optimise |
|---|---|---|---|
| Enable Regime Switching | On | Activates the two-regime model. Leave on in almost all cases — without it, the simulation chronically underestimates drawdown severity and duration. | — |
| Regime Stickiness (%) | 85% | Probability of staying in the current regime each trade. 85% = avg \~7 trades per regime. 95% = avg \~20 trades. | Higher for trend-following systems with long sustained runs. Lower (70–80%) for more erratic strategies. |
| Time in Adverse Regime (%) | 30% | Long-run proportion of trades in the adverse regime. Only used in Normal/Fat Tails modes — Bootstrap detects this from your history. | 30% is a reasonable baseline. Push to 40–50% if your strategy has genuine dead periods (e.g. mean-reversion in trending markets). |
| Adverse Win Rate (%) | 35% | Win rate during adverse periods. Normal/Fat Tails only. | Set to your observed bad-period win rate — typically 10–20% below your normal rate. |
| Adverse Risk : Reward | 1.2 | R:R during adverse periods. Normal/Fat Tails only. | Adverse conditions usually compress R:R — winners get cut, losses run. Use your observed bad-period figure. |
| Bootstrap Regime Window | 10 | Rolling window size for auto-classifying your historical trades into favourable/adverse. Smaller = more sensitive to short streaks. | Use 5–10 for strategies with frequent regime changes, 15–20 for slower-transitioning ones. Check the "Time in Adverse" stat — if it's detecting more adverse than expected, widen the window. |
Stress Test
| Setting | Default | What It Does | How to Optimise |
|---|---|---|---|
| Consecutive Losses | 10 | Shows the exact equity remaining after N losses in a row at current sizing. Deterministic — not a simulation. | Set to a number that feels uncomfortable but plausible. If the result breaches your ruin threshold, your sizing is too large. At 50% win rate, 10 consecutive losses has roughly a 0.1% chance per run — rare but inevitable over time. |
Thresholds
Three configurable probability queries. Each asks: "What percentage of simulations met this condition?" Define any combination of return or drawdown targets in either direction. The defaults answer: how often did the strategy return over 10%? Stay under 20% drawdown? End profitable at all?
Use these to set concrete probability requirements — e.g. requiring that 80% of simulations avoid a 25% drawdown before trading a strategy.
Display
| Setting | What It Does |
|---|---|
| Display Mode | All Paths / Fan Chart / Best / Worst — see above. |
| Line Style | Solid, Dotted, or Dashed. Dotted helps readability when many paths overlap. |
| Show Scale | Adds % labels on the Y-axis and trade markers on the X-axis. Leave on unless space is tight. |
| Show Side Charts | Enables the histogram and scatter plot, plus extra statistics in the table. |