Lot Sizing from SL Distance: A Risk-Percent Method
Contents
Bottom line: Set the lot size from "how much you can afford to lose"
Under risk-percent sizing, you first decide what percentage of your account balance you are willing to lose on a single stop-out. Then you work backward from the distance to the SL (stop loss) to get the lot size. This is where it differs from fixed lots. With a fixed lot, the loss is large on days when the SL is wide and small when it is tight, so the risk per trade changes every time.
However, you can't send the calculated lot straight to the broker. Brokers have a minimum lot, a maximum lot, and a lot step, and your margin has a ceiling too. This article also covers how and in what order to clamp the calculated value to those four constraints.
Recommended Broker Comparison →
🎁 Download Free EA📧 Free 8-email course + subscriber-only pack of 13 MT5 indicators
* Privacy strictly protected. You can unsubscribe at any time.
How it works: the back-calculation formula
The basic formula is:
Lot size = Acceptable loss ÷ (SL distance × value per unit of distance per lot)
As an example, take a ¥1,000,000 balance, 1% risk, and USDJPY with a 50-pip SL. The acceptable loss is ¥10,000. For 1 lot (100,000 units), 1 pip is worth about ¥1,000, so ¥10,000 ÷ (50 × ¥1,000) = 0.2 lots. If the SL widens to 100 pips, the lot is 0.1; if it tightens to 25 pips, the lot is 0.4. Whatever the SL width, the loss when stopped out stays at about ¥10,000.
In an MT5 EA, you get the "value per unit" from the symbol's SYMBOL_TRADE_TICK_VALUE (value of one tick) and SYMBOL_TRADE_TICK_SIZE (price size of one tick). Calculating in pips makes it easy to get the conversion wrong on symbols with different digit counts, gold, or crypto. Calculating in ticks is safer.
How far the balance falls in a losing streak
What matters in risk-percent sizing is that you can estimate in advance how far the balance falls during a losing streak. As an example, take MEGAMAX DONCHIAN and DONCHIAN ENGINE on USDJPY H1. Both had a maximum of 11 consecutive losses in backtests. At 1% risk per trade, 11 straight losses reduce the balance by about 10.5% (0.99 to the 11th power). At 2% per trade, the drop is about 20%. Look at the maximum losing streak, then pick a risk percent whose drawdown you can live with. That is the order of thinking.
Note that these two have almost the same backtest PF, at 1.55 and 1.5. Yet their effective DD is very different, at 58.6% and 10.8%, and so are their annualized returns, at 39.3% and 10.9%. Compared with PF, DD and annualized return depend heavily on how aggressively lots are sized. I won't claim to explain the full breakdown of that gap here, but it shows that "same PF" does not mean "same level of safety."
Clamping order and checklist
Adjust the calculated lot in this order.
| Step | Constraint | How to get it in MT5 | Action |
|---|---|---|---|
| 1 | Lot step | SYMBOL_VOLUME_STEP | Round down to a multiple of the step |
| 2 | Minimum lot | SYMBOL_VOLUME_MIN | If below it, skip the entry (or knowingly use the minimum lot) |
| 3 | Maximum lot | SYMBOL_VOLUME_MAX | If above it, cap at the maximum lot |
| 4 | Margin limit | OrderCalcMargin and free margin | If insufficient, reduce the lot and re-check from step 1 |
When fitting to the step, round down rather than to the nearest value. Rounding to the nearest can push you slightly above the risk percent you set.
When the result falls below the minimum lot, we believe skipping the trade is the right call. Rounding up to the minimum lot makes that one trade exceed your chosen risk percent. On a small account on a day with a wide SL, this happens every time. Be sure to check the EA's settings or manual to see which behavior it uses.
When choosing or configuring an EA, check the following:
- Whether the risk percent input is based on balance or on equity
- When the result is below the minimum lot, whether it skips or rounds up
- Whether it fits to the step by rounding down or to the nearest value
- When margin is insufficient, whether it reduces the lot or stops with an order error
Where to find these settings is summarized in How to set up an EA. You can also use the MT5 tools to estimate lot sizes.
Limits and cautions: losses won't always match the calculation
Even with risk-percent sizing, there is no guarantee that your loss is capped at the set amount. Here are the inconvenient points.
- Gaps and slippage: At the weekly open gap or during economic releases, orders can fill at a worse price than the SL. The loss in that case exceeds 1%.
- Costs are not in the formula: If you leave spread and commission out of the formula, the actual loss is a little larger.
- Tick value changes: For symbols where the account currency differs from the quote currency (anything other than JPY crosses, gold, and so on), the tick value moves with exchange rates. You can only calculate with the value at the time of the order.
- Risk adds up across multiple EAs: Even at 1% each, if 5 EAs open positions at the same time, you carry up to about 5% in total risk.
- Recovery is slow after losses: Because the lot shrinks in proportion to the balance, recovering from a drawdown tends to be slower than with fixed lots.
- Fixed lots can suit some EAs better: For averaging-down (grid/martingale-style) EAs or designs with no SL, the back-calculation formula doesn't apply in the first place.
Summary
- Risk-percent sizing back-calculates the lot as "acceptable loss ÷ value of the SL distance." Unlike fixed lots, the loss on a single stop-out stays roughly constant
- Calculate with tick value and tick size, not pips
- Clamp in this order: round down to the step → minimum → maximum → margin. Check whether the EA skips or rounds up when the result is below the minimum lot
- Estimate how far the balance falls in a losing streak in advance, from the maximum losing streak and the risk percent
- Gaps, costs, and combined risk across multiple EAs can make actual losses exceed the calculation
Related
📧 Free 8-email course + subscriber-only pack of 13 MT5 indicators
* Privacy strictly protected. You can unsubscribe at any time.
Have a question about EAs or FX?
You can post it on the Nattzy trading forum (free sign-up). Questions beyond this article are welcome too — EA settings, choosing a broker and more.
Ask on Nattzy ↗