Position Size Panel: how it sizes a trade, and the minimum-lot trap
I made Position Size Panel for one job: you type your risk and your stop, and it tells you the lot. It is a free MT5 utility. I never wrote about it on the blog, so this is its first post.
What it does
You attach it to a chart. The panel has three fields: risk, SL distance and R:R. It shows the lot size, the money at risk, the value of one pip or point per lot, and the TP distance. It also draws two draggable lines, SL and TP. Drag the SL line below the price and you preview a long trade. Drag it above and you preview a short one.
The formula
- Risk money = equity x risk % (or balance x risk %, or a fixed amount).
- Loss per lot = what one lot loses from entry to stop. The panel gets it from the broker's own contract data through OrderCalcProfit, not from a fixed pip value.
- Lot = risk money / loss per lot, rounded down to the lot step and capped at the broker's maximum.
Because of the rounding down, the real risk is a little below what you typed. The panel shows the real money and the real % after rounding.
Three examples
These are values on my demo account at my broker. Risk is 1% of equity, which is 100 USD in all three.
- EURUSD, 20 pips. One lot is 10.00 USD per pip, so 200 USD per lot. Lot: 0.50. TP at R:R 2.00 is 40 pips.
- Gold, 500 points. One lot is 1.00 USD per point, so 500 USD per lot. Lot: 0.20.
- US100, 500 points. One lot is 0.01 USD per point, so 5 USD per lot. Lot: 20.00.



The gold screenshot has the panel moved to the lower right with the corner input.
The minimum-lot trap
If the calculated lot is below the broker's minimum, the panel does not round up. It shows "min lot risks X% - trade skipped" in red, the BUY and SELL buttons are dimmed, and a click is refused.
Here is why it matters on gold. On my broker, 0.01 lot is 1 USD per 1 USD of price move. I measured a stop of 3.5 x ATR(20) on H1 at 0.01 lot over 2025-2026. The 25th percentile was 34 USD, the median 52 USD, the 90th percentile 91 USD.
Take a 1,000 USD account as an example. 1% is 10 USD. At 0.01 lot, those stops risk 3.4%, 5.2% and 9.1%. The minimum lot is already bigger than the risk you asked for. The panel tells you before you click.
Inputs that matter
- Risk mode and value: % of equity (default), % of balance, or a fixed amount. Default value 1.0.
- Default SL: 20 pips on forex, 500 points on gold, indices and other CFDs.
- Default R:R: 2.0. Set 0 for no TP.
- Lines: show or hide the SL and TP lines, and set their colours.
- Trading buttons: on by default. Orders go out only when you click BUY or SELL. Before sending, the code checks that trading is allowed, the lot, the broker's stops level and the free margin. The order is at market with the calculated SL and TP. In the Strategy Tester the panel only displays. Switch the buttons off and you get a pure calculator.
- Magic number, comment, max slippage: for the orders the buttons send.
- Panel corner, X/Y offset, font size.
Limits
It calculates. You decide. Contract sizes differ by broker: the same US100 trade can have a different value per point elsewhere. Check the numbers on your own account first.
Position Size Panel on the MQL5 Market: https://www.mql5.com/en/market/product/209377


