The formula
For the calculation mode commonly used for forex in MT5, profit is calculated like this.[1]
Profit = (close price − open price) × contract size (units per lot) × lots
You can find the contract size in the symbol specification.[2] Some brokers use 100,000 units per lot, others 10,000 or other sizes, so use your own account's value. Many other trading platforms work in a similar way.
Pips and points
In the MT5 symbol specification, each symbol has a number of decimal places (Digits) and a smallest price step (tick size).[2] MT5 measures things like the spread and the minimum stop distance in "points".[1] A point is usually one unit of the last decimal place.
"Pip" is not a term on the MT5 screen; it is a name traders commonly use. For most pairs, 0.0001 is usually called one pip, and for pairs quoted in yen, 0.01. In accounts that show 5 decimal places (3 for yen pairs), 1 pip = 10 points. If you mix up a screen that asks for points with one that asks for pips, your number will be 10 times too big or too small.
Worked examples
- Buy 0.1 lots of EUR/USD, 1.0850 → 1.0900: (1.0900 − 1.0850) × 100,000 × 0.1 = 50 USD (50 pips)
- Buy 0.1 lots of USD/JPY, 150.00 → 150.50: (150.50 − 150.00) × 100,000 × 0.1 = 5,000 JPY (50 pips). In a USD account it is converted at the exchange rate at that time; divided by 150.50, that is about 33 USD
- Sell 0.1 lots of EUR/USD, 1.0900 → 1.0850: for a sell, use (open price − close price): (1.0900 − 1.0850) × 100,000 × 0.1 = 50 USD
All are our example calculations, with 1 lot = 100,000 units. In a euro account, divide 50 USD by the EUR/USD rate at that time to convert it to euros. They leave out spread, commission and swap (see what is the spread).
Working backwards to a lot size
Using the same formula the other way, you can find a lot size from your stop distance and the amount you are willing to lose on one trade. For example, with a 0.0020 (20-pip) stop on EUR/USD and a maximum loss of 20 USD per trade: 20 ÷ (0.0020 × 100,000) = 0.1 lots (our example calculation). The position size calculator does this for you.
Check your own records (you decide)
This article does not decide what lot size you should trade. When a calculation and your actual result differ, logging these makes the reason easier to find:
- Your entry and exit prices, and lot size
- The difference between the calculated result and your account result (spread, commission, conversion, slippage)
- Why you chose that lot size, and how you felt
The profit and loss calculator and the stop-loss and take-profit calculator check the numbers. For terms, see the glossary.
Sources
- MetaQuotes. Symbol Properties (MQL5 Reference). https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants
- MetaQuotes. Market Watch (MetaTrader 5 Help). https://www.metatrader5.com/en/terminal/help/trading/market_watch