Gold is quoted in US dollars per troy ounce, and on this site one lot of XAU/USD is 100 troy ounces. That single fact does most of the work in a profit and loss calculation: multiply the change in price by the number of ounces you hold.
The formula
For a buy (long) position:
P/L = (closing price − opening price) × lots × 100
For a sell (short) position the sign flips: you gain when the price falls. Because gold is priced in US dollars and demo accounts are in US dollars, no currency conversion is needed. Costs are then subtracted: the spread is already inside the two prices, and on Standard, VIP and Swap Free accounts commission is charged half on opening and half on closing.
Ounces, not lots, carry the exposure
The same size number means different things on different instruments. 0.10 lots (10 troy oz) of gold moves by 10 USD for every 1.00 USD change in the gold price. 0.10 lots (10,000 EUR) moves 1 USD per pip. Always convert lots into units first; the order ticket in the demo terminal shows both.
Worked example: a profitable gold buy on a Standard account
Assumptions: Standard account, sample snapshot ask of 4,126.91; a later closing bid of 4,150.00 chosen for illustration. Commission USD 2.50 per lot per side (USD 5.00 round turn).
- Size: 0.20 lot × 100 oz = 20 oz.
- Buy opens at the ask: 4,126.91.
- Close at the bid: 4,150.00. Price change = 4,150.00 − 4,126.91 = 23.09 USD per ounce.
- Price P/L = 23.09 × 20 oz = 461.80 USD.
- Commission = 2.50 × 0.20 = 0.50 USD on open, plus 0.50 USD on close.
Net result = 461.80 USD − 0.50 USD − 0.50 USD = 460.80 USD.
Worked example: a losing gold sell on a Zero account
Assumptions: Zero account, sell at the sample bid of 4,126.71; price then rises and the position is closed at an ask of 4,134.21. No commission on Zero; its cost sits in the wider spread.
- Size: 0.10 lot = 10 oz.
- For a sell, P/L = (opening − closing) × ounces = (4,126.71 − 4,134.21) × 10.
- = −7.50 × 10 = −75.00 USD.
Net result = −75.00 USD. The spread was paid inside the two prices.
Checking a result in the terminal
When you close a position in the demo terminal, the confirmation lists price P/L, commission for both sides and the net amount credited to the balance. The same three lines appear in the trade history and in the CSV export from the activity page, so every result can be traced back to the opening and closing prices.
Common mistakes
- Using the mid price from the chart instead of the bid or ask you actually traded at.
- Treating 1 lot of gold like 1 lot of a currency pair: 100 ounces against 100,000 units of currency.
- Forgetting the commission on the closing side when comparing account models.
You can repeat these calculations with your own numbers in the profit and loss calculator. The prices here come from a fixed sample snapshot and the closing prices are hypothetical.
Educational material about how prices and costs are calculated. It is not advice on whether to trade. Leveraged products can lose money quickly; see the risk disclosure.