Position sizing is the calculation that decides how many lots to trade. It starts from two decisions already made, the amount you are willing to lose on the trade and the distance to the stop loss, and produces a lot size that makes those two consistent. It is the single most important calculation in trading, and the one most beginners skip.
The formula
Lots equals the risk amount divided by the stop distance in points multiplied by the value of one point on one lot.
The risk amount is a fraction of the account balance, typically between a quarter of one per cent and two per cent. The stop distance comes from the strategy. The point value per lot comes from the contract specification and, for pairs not quoted in the account currency, from the current exchange rate.
Currencies
A £10,000 account risks one per cent, £100, on a trade in EUR/USD with a 50-pip stop. One pip on one lot is $10, about £7.90 at a GBP/USD rate of 1.27. Fifty pips on one lot would risk £395, so the position is £100 divided by £395, about 0.25 lots. The broker's volume step of 0.01 makes it 0.25 exactly.
Gold
The same account risks £100 on gold with a $40 stop. One lot is 100 ounces, so a $40 move on one lot is $4,000, about £3,150. The position is £100 divided by £3,150, about 0.03 lots, three ounces.
Indices
The same account risks £100 on the DAX with a 150-point stop at a broker where one lot is €1 per point. A 150-point move on one lot is €150, about £128. The position is £100 divided by £128, about 0.78 lots. At a broker where one lot is €25 per point it would be 0.03 lots.
Why fixed lots are wrong
A fixed lot size, say 0.10 lots on every trade, means the amount at risk changes with every stop distance and never changes with the account. A trade with a 20-pip stop risks a fifth of one with a 100-pip stop. After a losing run, when the account is smaller, the same 0.10 lots is a larger share of it, so risk rises exactly when it should fall. After a winning run the reverse happens and the account grows more slowly than it could. Sizing by a percentage of balance fixes both: risk falls automatically in a drawdown and rises as the account grows.
Two traders each start with £10,000 and take the same 20 trades, each with a 50-pip stop in EUR/USD, of which 8 win 100 pips and 12 lose 50. The first trades a fixed 0.25 lots throughout and ends with a profit of about £790. The second risks one per cent of the current balance on each trade and ends with about £775, slightly less because the winners came late in the sequence and the account was smaller then. Over these 20 trades the difference is trivial. Now give both traders 12 losses in a row first. The fixed-lot trader is down £2,370, nearly 24 per cent. The percentage trader is down about £2,150, under 22 per cent, and every further loss is smaller. Over a long run of trades the gap widens, and in a bad run it is the difference between a drawdown and a ruined account.
When an EA describes its sizing as risk-based, this calculation is what it means: the EA takes a risk percentage, reads the stop distance for the trade and the point value for the symbol, and produces the lot size. The trader chooses the risk, not the lots.
Three things to verify. That the EA reads point value and contract size from the broker rather than assuming them. That it handles the minimum lot honestly, by skipping the trade or reporting that the minimum risks more than intended, rather than rounding up silently. And that the risk percentage is applied to something sensible, balance or equity, and not to a figure that grows when floating losses grow. An EA that asks for a fixed lot size per market has skipped the calculation and left it to you.