What-if and the Sizing Optimizer: how we keep the results honest

What-if and the Sizing Optimizer: how we keep the results honest

14 October 2026, 14:30
Abdullah Uygar Tuna
0
29

Every trader has asked it: what would these trades have made at another lot size? And right after: which sizing should I actually use?

Strategy Ledger Pro 4.43 answers both. The What-if Simulator replays your trades, from a backtest or now from your live account, at other sizes and costs. The Sizing Optimizer searches the sizing rules for one that would have held up.

The second question is the dangerous one. Give any optimizer enough settings to try and it will always find a beautiful curve in the past. That curve says more about luck than about the future. So we built both tools around one idea: a result only counts if it survives a fair test. This post explains how.

Part 1: the What-if Simulator

what if

1. Start from reality, to the cent

Before What-if shows a single alternative, it replays your trades exactly as they happened: AS TESTED for a backtest, AS TRADED for your live account. That replay must equal the real result to the cent. If the starting point is not exact, nothing built on it can be trusted.

2. Change one thing only: the size

Entries, exits and timing stay exactly as they were. What-if changes only how much each trade risks. The rules are FIXED LOT, PER BALANCE, x SIZE, EQUAL RISK, EQUAL DD and RISK BUDGET, with an optional DAILY STOP or BASKET STOP. Because nothing else moves, any difference you see comes from the sizing alone.

3. Money handled like a broker would

  • Amounts are rounded once, to the cent of your account currency.
  • A trade the simulated balance could not have paid the margin for is skipped, and the row says so.
  • Minimum lot, lot step and maximum lot come from your broker's symbol. Trades pushed up to the minimum lot are counted, because they risk more than your rule asked for.
  • On a live account, deposits and withdrawals stay on their own line, so they never look like profit or loss.

4. Costs you can question

AS TESTED keeps the tester's costs. YOUR BROKER prices the backtest with your account's own measured fills and commission, and says on every row where each cost came from. 2x STRESS doubles the slippage that went against you. If a result only works on cheap costs, you want to know before your broker tells you.

5. Assumptions stated, not hidden

A replay assumes a larger order would have filled at the same price as the original. Very large sizes can fill worse in reality, and 2x STRESS helps you check how sensitive the result is. Every screen is labelled SIMULATED.

Part 2: the Sizing Optimizer

You choose one goal: most growth within a drawdown limit (20% by default), least drawdown for a yearly growth target, or most growth at your current drawdown. The optimizer then tries the sizing rules and their values on your trades. What makes it different is how it decides whether a result means anything.

1. Choose on the past, judge on what it never saw

split

Your history is split by calendar time into a search part, where settings are chosen, and a check part, which the search never sees. Splitting by time, never by shuffling trades, means the check really is "the future" from the search's point of view.

When your history is long enough, the optimizer uses THOROUGH, a walk-forward check in three rounds: it searches on the first 50% and checks on the next 15%, then 65% and 15%, then 80% and the last 20%. The three check parts are chained into one curve, which shows what the method itself would have done going forward. Shorter histories use QUICK: one split of 70% and 30%.

2. No peeking: the calibration cutoff

Some rules learn a scale from your data. EQUAL DD, for example, needs to know your worst drawdown. If that worst drawdown sits in the check part, a naive replay would already "know" it while choosing, and the check would pass automatically. So in every round, each rule learns its scale only from trades that closed before the check part begins. Nothing from the unseen part can leak into the choice.

3. Flat ground, not a lone peak

flat

A setting is scored as the weakest of itself and its neighbours, one step smaller and one step larger. A lone spike, where a slightly different value would have done badly, is usually luck, and it gets marked down. A plateau, where nearby values do about as well, is what tends to survive in real trading. A missing neighbour at the edge of the range counts as a fail, so maximum leverage gets no head start.

4. A fair opponent: your own sizing

Doubling your size doubles both profit and drawdown. That is leverage, not an improvement. So every finalist is compared with your own sizing, scaled to the same drawdown, and must beat it by more than the statistical error of the comparison. A setting that only adds leverage cannot win.

5. Costs are never optimised

Costs are not a choice you get to make. Every finalist is re-run under 2x STRESS, and one that fails there is marked ONLY ON CHEAP COSTS.

6. It tells you how hard it looked

The more settings an optimizer tries, the more one of them looks good by chance. The result always says how many settings were tried, and the check result, not the search result, decides the verdict. A finalist must also rank in the top half of all settings on the unseen part, or it cannot be called HOLDS UP.

7. A plain verdict, in a fixed order

verdict

Every finalist gets one verdict, together with the number of setups and months it rests on. HOLDS UP also needs a check part of at least 3 months.

When nothing holds up, the page says so first. That is not an error. It is often the correct answer, and a tool that never says it cannot be trusted when it says the opposite.

Part 3: how we test the tester

noise

An honest method has to be tested the way a scientist tests a measuring instrument: on cases where the right answer is known.

We generated hundreds of synthetic trade histories with no real edge at all and ran the optimizer on each. Any HOLDS UP there is a false alarm. Our limit, set before the runs: the false alarm rate's 95% upper bound must stay at or under 10%. On 400 random histories the optimizer said HOLDS UP 7 times (1.8%). On 600 random histories with deposits and withdrawals, 14 times (2.3%).

The other blocking honesty tests passed as well, each in at least 357 of 360 runs. They are run again whenever the optimizer's rules change.

What it is not

  • It is not a forecast. Everything is simulated with hindsight on trades that already happened, and past results do not predict future results.
  • It never trades. Strategy Ledger Pro is read-only: it never places, changes or closes a trade, and OPEN IN WHAT-IF only shows a setting.
  • Nothing leaves your terminal.

Step-by-step guide to the Backtest Analyzer and What-if Simulator: https://www.mql5.com/en/blogs/post/777484

Strategy Ledger Pro on the MQL5 Market: https://www.mql5.com/en/market/product/192540

Questions about the method are welcome in the comments.