The Position Size Calculator indicator for MT4 works out the correct lot size for your trade right on the chart. Set your risk as a percent of equity or a fixed amount, drag the stop line to where your stop belongs, and the panel shows the lot size, the money at risk, the pip value per lot and, if you place a target line, the reward-to-risk ratio. It never places or changes orders.
It is the chart version of our online position size calculator, built for traders who want the answer without leaving MetaTrader 4.
What Is the Position Size Calculator Indicator?
Position sizing decides how much you lose when a stop is hit. Risking the same percentage on every trade means a wide stop gets a small position and a tight stop gets a larger one, so each loss costs about the same. Doing that math by hand for every trade is slow and easy to get wrong, especially on cross pairs or metals where one pip is not worth a round number.
This indicator reads the stop distance from a line on your chart and the contract details from your broker, then does the calculation every second. You see the result before you open the order ticket.
How the Calculation Works
1. Entry, stop and direction
- By default the entry is the live market price. If the stop line is below the Bid the trade is treated as long and the entry is the Ask. If the stop line is above the Bid it is treated as short and the entry is the Bid. Using the Ask for longs means the spread is included in the stop distance.
- With UseEntryLine set to true, a blue entry line appears and the calculator uses its price instead, which is useful for pending orders. Long or short is then decided by whether the stop line is below or above the entry line.
- With UseStopLine set to false, the stop is a fixed StopLossPips away from the entry in the DefaultDirection.
2. Money at risk
If RiskMoney is above zero, that fixed amount is used. Otherwise the risk is RiskPercent of your account equity (or balance, if you choose BASE_BALANCE). Equity includes the floating profit or loss of open trades, balance does not.
3. Lot size
The code reads five values from the broker for the current symbol: tick value, tick size, lot step, minimum lot and maximum lot. Then:
- Loss per 1.00 lot = stop distance / tick size x tick value
- Raw lots = money at risk / loss per 1.00 lot
- Lot size = raw lots rounded down to the broker’s lot step, so the real risk never exceeds your setting
If the result is below the broker’s minimum lot, the panel shows 0 and tells you how much you would risk at the minimum lot, so you can decide whether to widen your risk or skip the trade. If it is above the maximum lot, it is capped and flagged.
Example: with 10,000 USD equity and 1 percent risk, the money at risk is 100 USD. On EUR/USD with a 5-digit quote, tick size 0.00001 and a tick value of 1 USD per lot, a 20-pip stop loses 200 USD per lot. 100 / 200 = 0.50 lots.
4. Pip value and reward:risk
Pip value per 1.00 lot is one pip divided by tick size times tick value. A pip is 10 points on 5-digit and 3-digit quotes and one point otherwise. If the take-profit line is on the correct side of the entry, the panel shows the target in pips and the ratio of target distance to stop distance, such as 2.00 : 1.
Key Features
- Lot size from percent risk or a fixed money amount, based on equity or balance.
- Draggable stop, take-profit and optional entry lines. The panel updates as soon as you drag.
- Rounds down to the broker’s lot step and respects minimum and maximum lot size.
- Shows actual money at risk after rounding, as an amount and a percent.
- Pip value per standard lot in your account currency.
- Reward-to-risk readout from the take-profit line.
- Timer-based refresh, so values stay current between ticks.
- No trading functions: it cannot open, modify or close positions.
How to Trade With the Position Size Calculator Indicator
- Attach the indicator to the chart you plan to trade and set RiskPercent (or RiskMoney).
- Drag the red stop line to your planned stop: below the swing low for a long, above the swing high for a short.
- Drag the green line to your target if you use one, and check that the reward:risk ratio meets your rules.
- Copy the lot size from the panel into the order ticket and place your order with the same stop price.
Stops work best when they sit outside normal noise. The Candle Pips indicator shows the average candle range, which helps you judge whether a stop is too tight. Signal tools such as the 3 EMA Crossover indicator or the Supply and Demand indicator give you the levels, and the calculator gives you the size.
Best Settings
- RiskPercent: many traders use between 0.5 and 2 percent per trade. Pick a level you can sustain through a long losing streak.
- RiskBase: balance gives a steadier figure while trades are open. Equity adjusts automatically after open trades move.
- UseEntryLine true: when planning limit or stop orders away from the current price.
- PanelCorner: move it away from the one-click trading panel if you use it, for example to CORNER_LEFT_LOWER.
Line Behavior and Limitations
- If you delete one of the lines, it is recreated at its default distance on the next refresh. Set UseStopLine or UseTakeProfitLine to false to remove a line for good.
- When you change the timeframe or the inputs, the lines keep their positions. When you switch the chart to another symbol, they are reset to default distances for the new symbol.
- Removing the indicator removes the panel and all of its lines.
- For pairs where your account currency is not the quote currency, the broker’s tick value is converted at current rates, so the result is an estimate that can shift slightly as rates move.
- On metals, indices and crypto, check how your broker defines a pip. The lot size is still correct because it uses tick size and tick value directly, but the pip readout follows the 10-points-per-pip rule only on 3- and 5-digit symbols.
Does It Repaint?
No. The panel is a calculator, not a signal. It shows no arrows or historical values, so there is nothing to repaint. It simply recalculates from your current account and line positions.
How to Install
Copy “position-size-calculator-indicator-mt4.mq4” to File > Open Data Folder > MQL4 > Indicators, restart MT4 or refresh the Navigator, and drag it onto the chart. Step-by-step help is in how to install indicators in MT4. Because it is an indicator and not an Expert Advisor, it does not need AutoTrading enabled.
Related Tools
- Pip value calculator for any pair and account currency.
- Candle Timer indicator shows the spread and time left on the candle.
- Daily Support and Resistance Special indicator marks levels for stop placement.
Position sizing controls how much a losing trade costs but does not make a strategy profitable. Trading on margin carries a high level of risk, so practice the workflow on a demo account first.
