Stopline Trade Manager › Guides
How position size is calculated in MT5 and MT4
A position size calculator answers one question: how many lots can I trade so that, if the stop loss is hit, I lose the amount I decided to risk and no more? The maths is the same in MetaTrader 5 and MetaTrader 4.
The formula
You need three numbers:
- Risk in money: a fixed amount, or a percentage of your balance, equity or free margin.
- Stop distance: from the entry to the stop loss, in points.
- Value of one point for one lot: what the account gains or loses per point on a 1.00-lot position. MetaTrader calls it the tick value, per tick size.
Lot size = risk in money ÷ (stop distance in points × value of one point per lot)
Then round down to the broker's volume step (usually 0.01), so the rounded lot never risks more than you set.
A worked example on EURUSD
An account of 10,000 USD, risk 1 %, a buy on EURUSD with the stop 25 pips below the entry:
| Step | Value |
|---|---|
| Risk in money | 1 % of 10,000 USD = 100 USD |
| Stop distance | 25 pips = 250 points (5-digit quotes: 1 pip = 10 points) |
| Value of one point per lot | 1 USD (100,000 units × 0.00001) |
| Loss per lot at the stop | 250 × 1 USD = 250 USD |
| Lot size | 100 ÷ 250 = 0.40 lots |
Move the stop to 40 pips and the same 100 USD buys only 0.25 lots. The stop decides the size, not the other way round: that is the point of sizing from risk.
Where manual calculations go wrong
Tick value on gold, indices and cross pairs
On EURUSD with a USD account one point is worth 1 USD per lot. On XAUUSD, an index CFD, a cross pair or an account in another currency it is something else, and some brokers publish a tick value that differs from what the account actually books. A lot sized from the wrong value risks more, or less, than you meant.
Rounding up
0.437 lots rounded to 0.44 risks a little more than planned; rounded down to 0.43 it does not. Over many trades "a little more" adds up, which is why a calculator should round down.
The minimum lot
If the risk is small and the stop is wide, the formula can give less than the broker's minimum lot. Trading the minimum then risks more than you set; the honest answers are a larger risk or a narrower stop.
Spread and commission
The formula measures the distance from your entry price to the stop. Commission is charged on top, so on accounts with commission leave a little room for it.
How Stopline Trade Manager does it
- You type the risk as an amount or a percentage of one of nine bases: balance, equity, free margin, a custom base, the balance at the start of the previous day, week or month, or the maximum lot the free margin allows.
- You drag the orange stop loss line on the chart, or type the stop in pips or as a price. The lot, the money at risk and the reward-to-risk ratio update while you drag.
- The lot uses the tick value your account actually books, with a warning when the broker's published figure is different, and it is rounded down to the volume step, so a 1 % trade never becomes 1.3 %.
- If the risk is too small for the minimum lot, the panel says so instead of rounding up.
- A confirmation shows the lot, entry, stop, target, risk and reward in money and the margin before anything is sent.
The same calculator is in both editions: Stopline Trade Manager MT5 and Stopline Trade Manager MT4 on the MQL5 Market.