Position Sizing Calculator for Gold (XAUUSD) Trading: Step-by-Step Guide (2026)

Quick Answer

Lots = (equity x risk %) / (stop distance in dollars x contract size), then round DOWN to the volume step and recompute the risk you actually took. Add the spread and any commission to the loss per lot before you divide. Hypothetical example: $5,000 account, 1% risk, a $12.50 stop plus $0.30 spread and $7 commission per lot gives 0.0389 lot, which rounds down to 0.03 lot and a real risk of $38.61 (0.77%). Golden Viper EA does not size trades this way: it uses a fixed lot ladder (a small start lot, plus a fixed step per level), so this hand method is for manual trades and for sanity-checking the lot size of any EA on your own account.

Most position-size guides stop at one formula and a table. The formula is the easy part. What actually moves your real risk away from the number you intended is everything around it: the broker's volume step, the minimum lot, the spread you forgot, the commission, the margin the trade ties up, and, for euro or pound accounts, the currency the tick value is quoted in. This guide builds the whole chain so you can reproduce every figure in a spreadsheet or by hand.

All dollar figures below are illustrative. The account sizes, the $3,000.00 entry price, the spread, the commission and the exchange rates are assumptions chosen to make the arithmetic easy to follow. They are not market quotes, broker prices or trading results. Unless stated otherwise the account is in US dollars. Trading leveraged gold carries a substantial risk of loss, and no sizing method removes it.

The Formula Chain, Step by Step

The usual pip-based version of the formula depends on how your broker defines a gold pip, and brokers do not agree. Work in dollars of price instead. One standard lot of XAUUSD is normally 100 troy ounces, so a $1.00 move in price is $100 per 1.00 lot, or $1.00 per 0.01 lot. The 100-ounce unit matches the contract size of CME Group's gold futures (CME gold futures fact card), but your broker's own CFD specification is the number that counts, and you should read it rather than assume it.

  1. Risk budget = equity x risk %. Use current equity, in your account currency, and convert to dollars if the account is not in dollars.
  2. Loss per 1.00 lot = (stop distance + spread) x contract size + commission per lot. Stop distance is measured in dollars of price from the expected fill to the stop.
  3. Raw lots = risk budget / loss per lot.
  4. Final lots = raw lots rounded DOWN to the volume step, then held inside the broker's minimum, maximum and aggregate-volume limits.
  5. Effective risk = final lots x loss per lot, divided by equity to get a percentage. This is the number you actually accepted.
  6. Margin = final lots x contract size x price / leverage. Then check free margin after the trade.

Every input in that chain comes from a documented MetaTrader property. The MQL5 symbol-property reference lists them, and SymbolInfoDouble is the call an EA or script uses to read them.

MQL5 propertyWhat the reference says it holdsWhere it enters the chain
SYMBOL_TRADE_CONTRACT_SIZEThe trade contract sizeConverts a dollar move into dollars per lot (step 2) and sets margin (step 6)
SYMBOL_TRADE_TICK_SIZEThe minimal price changeCounts ticks in the stop when you use the tick-value route
SYMBOL_TRADE_TICK_VALUE (and the _LOSS variant)The calculated tick price; the _LOSS variant is the one defined for a losing positionAlternative to contract size for loss per lot; check which currency it is quoted in (see the currency section)
SYMBOL_VOLUME_MINMinimal volume for a dealThe floor on lots (step 4); creates the minimum-lot problem
SYMBOL_VOLUME_STEPMinimal volume change step for deal executionThe grid you must round down to (step 4)
SYMBOL_VOLUME_MAXMaximal volume for a dealThe cap on a single order (step 4)
SYMBOL_VOLUME_LIMITMaximum aggregate volume of an open position and pending orders in one directionA second cap that matters when you scale in
SYMBOL_MARGIN_INITIALMargin in the margin currency to open one lotCross-check for your own margin figure (step 6), when the broker sets it

There are two routes to loss per lot, and they should agree. Route one is the contract-size route above. Route two is (stop distance / tick size) x tick value. If your symbol shows a $0.01 tick size, a 100-ounce contract and a $1.00 tick value in a dollar account, the routes match: a $12.80 stop is 1,280 ticks x $1.00 = $1,280, and 12.80 x 100 = $1,280. When the two routes disagree, one of your assumptions (contract size, tick size or the currency of the tick value) is wrong, and you have found the error before it cost you money.

Worked Example: $5,000 Account, 1% Risk

Hypothetical inputs (illustrative, not a result): equity $5,000, risk 1%, planned stop $12.50 beyond the entry, spread $0.30, commission $7.00 per round-turn lot, contract size 100 oz, volume step and minimum 0.01, assumed entry price $3,000.00, leverage 1:30.

  • Risk budget: $5,000 x 1% = $50.00
  • Loss per 1.00 lot: ($12.50 + $0.30) x 100 + $7.00 = $1,280.00 + $7.00 = $1,287.00
  • Raw lots: $50.00 / $1,287.00 = 0.03885
  • Round down to the 0.01 step: 0.03 lot
  • Effective risk: 0.03 x $1,287.00 = $38.61, which is 0.772% of equity. About $11.39 of the budget is deliberately left unused.
  • Margin at 1:30: 0.03 x 100 x $3,000 / 30 = $300.00. At 1:100 it is $90.00.
  • Free margin after the trade, assuming no other open positions: $5,000 - $300 = $4,700 at 1:30, or $4,910 at 1:100.

Both the spreadsheet formulas and the Python function later in this guide reproduce these numbers exactly: 0.03 lot, $38.61, 0.772%, $300.00 and $90.00. Notice that the trade risks 0.77% of the account but ties up 6% of it as margin at 1:30. Risk and margin answer different questions, and a position can look safe on one and uncomfortable on the other.

Rounding Down and the Effective Risk

The raw answer almost never lands on a tradable volume. Round to the nearest step and about half of your trades will exceed the budget. In the example above the nearest step to 0.03885 is 0.04, which would risk 0.04 x $1,287 = $51.48, or 1.03%: over the budget you set. Rounding down guarantees the effective risk never exceeds the intended risk (before slippage), and the cost is that you sometimes take less than you planned.

How much less depends on how coarse the step is relative to your account. In this example one 0.01 step is worth $12.87 of risk. On a $5,000 account that is 0.26% of equity per step, so the effective risk can fall up to about a quarter of a percent short of the target. On a $50,000 account the same step is 0.026% and the shortfall is almost invisible. On a $1,000 account one step is 1.29%, which is already above a 1% budget, and that leads straight into the minimum-lot problem below.

There is one software trap worth knowing before you code this. Computers store most decimal fractions approximately (the Python documentation on floating-point arithmetic explains why), so a naive round-down can land one step too low. In Python, 0.29 / 0.01 evaluates to 28.999999999999996, and flooring it gives 28 steps, which is 0.28 lot instead of 0.29. The fix used in the snippet below is to round the quotient to nine decimals before flooring. For money-critical code the standard-library decimal module is the cleaner option.

The Minimum-Lot Problem on Small Accounts

If the raw answer is below SYMBOL_VOLUME_MIN, the formula has no valid output. You have three honest choices: skip the trade, take the minimum lot and accept more risk than planned, or change the account size. Quietly widening your risk is the choice most small-account traders make without noticing. Cutting the stop to fit the budget is the wrong fix, because the stop should come from where the trade idea is wrong, not from how small your account is.

The test is simple. At a 100-ounce contract, 0.01 lot is 1 ounce, so 0.01 lot loses exactly the stop distance in dollars. It fits a 1% budget only if the stop in dollars is no larger than 1% of equity in dollars.

Account equity1% budgetLargest stop where 0.01 lot fits0.01 lot with a $15 stop0.01 lot with a $30 stop0.01 lot with a $50 stop
$500$5$5.003.0%6.0%10.0%
$1,000$10$10.001.5%3.0%5.0%
$2,000$20$20.000.75%1.5%2.5%
$5,000$50$50.000.3%0.6%1.0%
$10,000$100$100.000.15%0.3%0.5%

Read the table as a floor: the percentages are the smallest risk a 0.01-lot trade can have at that stop distance. A $1,000 account trading a $15 stop cannot go below 1.5% on a single trade at a 0.01 minimum, no matter what the settings say. Check your own SYMBOL_VOLUME_MIN, because brokers do not all use the same minimum. The same floor applies to automation: an EA whose computed lot falls below the broker minimum has to either skip or round up to it. The Golden Viper source clamps up to the broker minimum, so the floor applies to it as well. For account-size-specific walk-throughs see the guide on lot size for a $1,000 account.

Spread and Commission Belong in the Stop Distance

A buy fills at the ask but a long stop triggers on the bid. So the distance that actually costs you money runs from the ask fill to the stop, which is the chart distance plus the spread. Example (hypothetical): bid 3,000.00, ask 3,000.30, stop at 2,987.50. You buy at 3,000.30 and are stopped at 2,987.50, a $12.80 loss per ounce, even though the stop looks $12.50 below the bid you were watching. A short works the mirror way: sell at the bid, stop triggers on the ask.

When you read the distance from an already-open trade's open price to its stop, the spread is already inside it, so do not add it again. When you plan from the chart's bid line, add it.

Commission is a per-lot dollar charge on brokers that use raw spreads. Convert it to dollars per 1.00 lot for a full round trip and add it to loss per lot, as in the worked example ($7.00 added to $1,280.00). Swap does not belong in the formula; it accrues with time and matters for trades held across rollover. For how costs behave on gold specifically, see gold spreads and commissions and XAUUSD slippage and spreads.

None of this makes the stop a guarantee. Slippage in fast markets or a gap can fill a stop worse than its price, so the computed risk is a plan, not a ceiling. The formula gives the loss if the stop fills at its price.

The Margin Check and Free Margin After the Trade

Margin is a separate calculation from risk. MetaTrader's help lists the retail forex formula as volume in lots x contract size / leverage, and a contract-type formula as volume in lots x contract size x open market price / leverage, using the ask for buys and the bid for sells (MetaTrader 5 margin help). It also says the margin currency is usually the symbol's base currency and is converted to your deposit currency at the current rate. For gold, the base-currency route converted at the gold price and the price-times-contract route land on the same expression in dollars: margin = lots x contract size x price / leverage. Brokers can apply their own margin rates or tiers, so confirm with the symbol specification.

To check a planned order against what the platform will really demand, MQL5's OrderCalcMargin estimates the margin for a planned operation under current market conditions, ignoring your existing positions. After your own arithmetic, free margin after the trade = equity - margin used by this trade - margin already used by other positions.

On leverage, jurisdiction matters. ESMA's product-intervention measures, published on 1 June 2018 and applied from 1 August 2018, cap retail CFD leverage at 30:1 for major currency pairs and 20:1 for non-major pairs, gold and major indices. They also require providers to close out a retail client's positions when margin falls to 50% of the minimum required, and apply negative balance protection (ESMA announcement). So the 1:30 column in the scenario table is a generic reference level; if your broker is bound by the 20:1 gold limit, multiply the 1:30 margins by 1.5 (0.03 lot would need $450 instead of $300). Our dedicated guide to margin requirements for XAUUSD at 1:30 leverage covers margin level and calls in depth, so this guide keeps to the sizing interaction.

The Account-Currency Trap for EUR and GBP Accounts

Gold is quoted in dollars. If your account is in euros or pounds, the risk budget is in euros or pounds but the loss per lot is in dollars. The MT4 reference describes MODE_TICKVALUE as the tick value in the deposit currency (MQL4 market info reference), so a tick value read from the platform is already converted. The MQL5 property table, in contrast, does not state a currency for SYMBOL_TRADE_TICK_VALUE. Do not guess: compare the value your terminal shows with contract size x tick size x the current conversion rate and confirm which currency it is in.

Hypothetical example, with a stated rate. Assume EURUSD = 1.10 (an illustrative rate, not a quote). Account equity EUR 5,000, risk 1% = EUR 50 = $55.00. Planned stop plus spread: $10.50, so loss per lot is $1,050.00.

  • Correct: $55.00 / $1,050.00 = 0.0524 lot, rounded down to 0.05 lot. Effective risk = 0.05 x $1,050 = $52.50, which is EUR 47.73, or 0.955% of equity.
  • Trap: treating the EUR 50 budget as $50 gives $50.00 / $1,050.00 = 0.0476, rounded down to 0.04 lot. That is 20% smaller than intended, and nothing on screen warns you.
  • Margin follows the same logic: 0.05 lot at an assumed $3,000 and 1:30 needs $500.00, or EUR 454.55 at 1.10.

The direction of the error depends on the currency. For accounts denominated in a currency that is worth more than a dollar (EUR, GBP), the trap undersizes. For accounts in a currency worth much less per unit (a yen account is the extreme case), the trap oversizes, potentially by two orders of magnitude, because a budget of 1,000,000 units gets read as one million dollars. Convert first, then size.

Ready-to-Paste Spreadsheet Formulas

This works in Excel and Google Sheets. Put labels in column A and values in column B, starting at row 2. Type the risk cell as 1% so it holds 0.01.

INPUTS (column B)
B2   equity, in account currency                  5000
B3   risk per trade                                1%
B4   stop distance, fill to stop, $ of price       12.50
B5   spread, $ of price                            0.30
B6   commission, USD per 1.00 lot round turn       7
B7   contract size, oz (SYMBOL_TRADE_CONTRACT_SIZE) 100
B8   volume step (SYMBOL_VOLUME_STEP)              0.01
B9   volume min (SYMBOL_VOLUME_MIN)                0.01
B10  volume max (SYMBOL_VOLUME_MAX)                100
B11  entry price, $ per oz                         3000
B12  leverage (30 means 1:30)                      30
B13  USD per 1 unit of account currency            1
B14  below minimum: 1 = trade min lot, 0 = skip    0
OUTPUTS (paste these formulas)
B16  risk budget, USD       =B2*B3*B13
B17  loss per 1.00 lot, USD =(B4+B5)*B7+B6
B18  raw lots               =B16/B17
B19  final lots             =IF(B18<B9, IF(B14=1,B9,0), MIN(B10, ROUND(ROUNDDOWN(ROUND(B18/B8,9),0)*B8, 8)))
B20  effective risk, USD    =B19*B17
B21  effective risk, %      =B20/(B2*B13)
B22  margin, USD            =B19*B7*B11/B12
B23  free margin after, USD =B2*B13-B22

The inner ROUND(...,9) is the floating-point guard from the rounding section. With the sample inputs the sheet returns 0.03 lot, $38.61, 0.772%, $300.00 margin and $4,700.00 free margin. I could not run Excel or Google Sheets itself, so I translated each formula function for function (IF, MIN, ROUND, ROUNDDOWN) into Python and compared it with the Python function below on eight input sets, including a minimum-lot case, a skip case, a euro-account case and a 1:100 case; every output matched. Paste the sheet in and compare it with the sample figures before you rely on it. Change B13 to your account's conversion rate (for example 1.10 in the euro example) and the same sheet handles the currency trap.

A Python Version, Run and Checked

import math

def size_xauusd(equity, risk_pct, stop, spread=0.0, commission=0.0,
                contract=100, step=0.01, vmin=0.01, vmax=100.0,
                price=3000.0, leverage=30, fx=1.0, take_min=True):
    """fx = USD per 1 unit of account currency (1.0 for a USD account)."""
    equity_usd = equity * fx
    budget = equity_usd * risk_pct / 100                    # risk budget, USD
    loss_per_lot = (stop + spread) * contract + commission  # USD lost per 1.00 lot at the stop
    raw = budget / loss_per_lot
    lots = math.floor(round(raw / step, 9)) * step          # round DOWN to the volume step
    if lots < vmin:
        lots = vmin if take_min else 0.0                    # minimum-lot problem
    lots = round(min(lots, vmax), 8)
    risk_usd = lots * loss_per_lot
    margin = lots * contract * price / leverage
    return dict(budget=round(budget, 2), loss_per_lot=round(loss_per_lot, 2),
                raw=round(raw, 4), lots=lots, risk_usd=round(risk_usd, 2),
                risk_pct=round(risk_usd / equity_usd * 100, 3),
                margin=round(margin, 2), free_after=round(equity_usd - margin, 2))

print(size_xauusd(5000, 1, 12.50, spread=0.30, commission=7, leverage=30))
# {'budget': 50.0, 'loss_per_lot': 1287.0, 'raw': 0.0389, 'lots': 0.03,
#  'risk_usd': 38.61, 'risk_pct': 0.772, 'margin': 300.0, 'free_after': 4700.0}
print(size_xauusd(5000, 1, 10.50, fx=1.10)['lots'])   # 0.05  EUR account, correct
print(size_xauusd(5000, 1, 10.50, fx=1.00)['lots'])   # 0.04  EUR treated as USD

We ran this code before publishing. It prints 0.03 lot, $38.61 and 0.772% for the worked example, $300.00 margin at 1:30 and $90.00 at 1:100, 0.05 versus 0.04 lot for the euro example, and every row of the scenario table below. It models a single position and ignores swap and slippage by design. It is a calculator, not a trading system, and it is only as accurate as the inputs you read from your own broker's specification.

Fourteen Worked Scenarios

The table uses a USD account, a 0.01 step and minimum, an assumed entry price of $3,000.00, no commission, and a stop distance that already includes the spread. Where the raw lots fall below 0.01, the row shows the minimum lot taken anyway, so the actual risk exceeds the target. Margin is shown at 1:30 and 1:100.

AccountRisk %Stop ($)Raw lotsLots usedActual riskMargin 1:30Margin 1:100
$5001%100.00500.01 (min)$10.00 (2.0%)$100$30
$5001%200.00250.01 (min)$20.00 (4.0%)$100$30
$1,0001%100.01000.01$10.00 (1.0%)$100$30
$1,0002%200.01000.01$20.00 (2.0%)$100$30
$2,0001%150.01330.01$15.00 (0.75%)$100$30
$2,5002%120.04170.04$48.00 (1.92%)$400$120
$5,0000.5%250.01000.01$25.00 (0.50%)$100$30
$5,0001%150.03330.03$45.00 (0.90%)$300$90
$10,0001%200.05000.05$100.00 (1.00%)$500$150
$10,0002%300.06670.06$180.00 (1.80%)$600$180
$25,0001%250.10000.10$250.00 (1.00%)$1,000$300
$25,0000.5%150.08330.08$120.00 (0.48%)$800$240
$50,0001%400.12500.12$480.00 (0.96%)$1,200$360
$100,0000.25%180.13890.13$234.00 (0.23%)$1,300$390

Three patterns stand out. First, the first two rows are the minimum-lot problem in action: a nominal 1% plan became 2% and 4%. Second, the $1,000 rows land exactly on the minimum only because the stop was chosen to fit; widen either stop and the risk climbs past the budget. Third, the $25,000 and $100,000 rows show rounding shaving 4% to 6% off the target risk, which is the safe direction. For broader reasoning on how a risk percentage should be chosen, see the guides on risk percentage per trade and position size for gold trades; this guide deliberately does not repeat their datasets.

Try Golden Viper EA free for 3 days A gold grid EA for MT5 cent accounts, with a live account you can check on Myfxbook. Start with a free trial key, then choose 1 month for $49, 1 year for $199 or lifetime for $299.
Start Free 3-Day Trial →

Golden Viper Sizes Automatically: Checking Any EA's Lots

Golden Viper EA does not ask for a risk percentage: its start lot and lot step are fixed and built in. Level 1 opens at the start lot, and each further level of the basket adds the lot step, with no multiplier. There is no stop loss and no equity stop. Brokers' cent contract sizes differ, so check yours before judging what a given lot means in dollars.

The key point for this guide: Golden Viper's lot sizes do not come from a risk percentage. They follow a fixed ladder, so the implied risk is not constant: it rises with each level and depends on how far price runs against the basket. That is exactly why it is worth computing, and why the hand method is useful even if you never place a manual trade.

How to compute the implied risk of any open EA trade:

  1. Open the Trade tab (MT5: Toolbox; MT4: Terminal). Note the lot size (Volume in MT5, Size in MT4), the open price and the S/L.
  2. Implied risk at the stop = lots x contract size x |open price - S/L| + commission. The open price is the actual fill, so the spread is already inside the distance.
  3. Divide by account equity (or balance, if that is what your risk rule uses) for the percentage.
  4. Hypothetical example: a buy of 0.09 lot opened at 3,000.30 with S/L at 2,985.30 is a $15.00 distance. 0.09 x 100 x $15.00 = $135.00, which is 1.35% of a $10,000 account. By comparison, the hand formula at 1% and the same distance gives 0.0667, or 0.06 lot.
  5. If the S/L field is empty, the implied risk to a stop is undefined. Golden Viper opens positions without an S/L and has no equity stop, so its worst case is not capped by the EA.
  6. Repeat across several trades and log equity at entry next to lots. For an EA that sizes from equity, the ratio of lots to equity should stay roughly constant before rounding. Golden Viper does not size that way: its level 1 lot is the fixed start lot, so expect a flat level 1 lot instead. If a lot jumps unexpectedly, check whether your broker changed its volume rules; Golden Viper has no lot setting that could have changed.

The same audit works on any EA or signal service. Many vendors state a risk percentage in marketing material; the open-trade check tells you what the account actually did. For the equity-path consequences of a string of full-size stops see drawdown explained, and for how lot size grows as equity grows see compounding EA profits.

What This Means for an H4 XAUUSD EA

The timeframe changes the arithmetic through the stop distance, which sits in the denominator. Hypothetically, on a $10,000 account at a 1% budget ($100.00): a tight $5 stop gives 100 / (5 x 100) = 0.20 lot and $2,000 of margin at 1:30 and an assumed $3,000 price, while a wider $25 stop gives 100 / (25 x 100) = 0.04 lot and $400 of margin. The dollar risk is identical; the position is five times smaller. Swing-scale stops mean smaller lots for the same budget, and the lot step becomes a larger fraction of the position, which is why the minimum-lot table matters so much for small accounts running H4 strategies.

Golden Viper is an averaging-down grid: XAUUSD only, on MT5, with no stop loss. A few deep baskets can outweigh many small wins, which is the sizing question made concrete. In a simulation run by the vendor (not live) on XAUUSD from 1 March to 2 November 2026, with the built-in settings, a 100,000 start balance (the size of a $1,000 cent account) and 1-minute data from one broker demo feed, 99.3% of 3,258 baskets closed in profit. The 22 losing baskets, all closed by the Friday close, lost 88,137 combined (account units), the worst basket lost 50,882 across 47 levels, and the largest equity drawdown was 89,497 (27.6% maximal), with May 2026 a losing month. Whatever the implied risk is on your account, that is the stress you are agreeing to. The live account is on Myfxbook (Golden Viper EA on Myfxbook). Past results do not predict future results, and nothing here is a profit promise.

Because the EA is a grid, it stacks positions within a basket, so check your Positions tab rather than assuming. If you want to run the EA at all, work through the installation guide first and evaluate it through its public live Myfxbook record; it does not run in the Strategy Tester, so it cannot be backtested. All sales are final, so evaluate it before purchase: besides the live record, a free 3-day trial key (one per email and per MT5 account) lets you run it on your own account first.

A Pre-Trade Checklist

  1. Read contract size, tick size, volume min, step and max from your own broker's specification, not from a guide.
  2. Confirm the currency of the tick value, and convert your equity if the account is not in dollars.
  3. Set the stop from the trade idea first, then size to it.
  4. Add spread (if measuring from the bid line) and commission to loss per lot.
  5. Compute raw lots, then round DOWN to the volume step.
  6. If below the minimum lot, decide in advance: skip, or accept the higher risk in writing.
  7. Compute effective risk in dollars and as a percent of equity, using the rounded lots.
  8. Compute margin, then check free margin after the trade and your broker's leverage cap.
  9. Remember slippage and gaps can exceed the plan; the formula assumes the stop fills at its price.

Frequently Asked Questions

How do I calculate XAUUSD lot size from a stop in dollars?

Lots = (equity x risk %) / (stop distance in dollars x contract size), with contract size normally 100 oz. For example, $5,000 x 1% = $50, a $15 stop gives a loss of $1,500 per 1.00 lot, so raw lots are 50 / 1,500 = 0.0333, which rounds down to 0.03 lot. Add spread and commission to the loss per lot before dividing, and read the contract size from your broker's specification.

Why round down instead of to the nearest lot step?

Rounding to the nearest step pushes the real risk above your budget about half the time. In the $5,000 example, 0.0389 lot rounds to 0.04 at nearest, which risks 1.03% instead of 1%. Rounding down keeps the effective risk at or below the target before slippage, at the cost of sometimes risking a little less than planned.

What if the formula gives less than the minimum lot?

You can skip the trade, take the minimum lot and accept the higher risk, or increase the account size. Do not shrink the stop just to fit the budget. At a 100 oz contract, 0.01 lot loses the stop distance in dollars, so it fits a 1% budget only if the stop in dollars is no more than 1% of equity in dollars. Check your SYMBOL_VOLUME_MIN, since brokers differ.

Should spread and commission be added to the stop distance?

Yes, when you plan from the chart's bid line. A buy fills at the ask and stops on the bid, so the real loss distance is the chart distance plus the spread. Commission is a per-lot dollar charge, so add it to the loss per lot. If you read the distance from an open trade's open price to its stop, the spread is already included.

How do I check margin before I enter a gold trade?

Margin = lots x contract size x price / leverage. For 0.03 lot at an assumed $3,000 and 1:30, that is 0.03 x 100 x 3,000 / 30 = $300. Then check free margin after the trade. In MQL5, OrderCalcMargin estimates the margin for a planned order. If your broker is bound by the ESMA 20:1 limit for gold, margin is 1.5 times the 1:30 figure.

Does my account currency change the calculation?

Yes. Gold's loss per lot is in dollars, so a euro or pound budget must be converted first. In the hypothetical example at an assumed EURUSD of 1.10, a EUR 5,000 account risking 1% has a $55 budget, giving 0.05 lot; treating the EUR 50 as dollars gives 0.04 lot. The MT4 reference describes tick value as being in the deposit currency; confirm what your MT5 terminal shows.

Does Golden Viper EA use this formula?

No, not as a stop-based risk formula. The EA does not calculate lot size from equity and a risk percentage: it uses a fixed lot ladder (a small start lot, plus a fixed step per level) and has no stop loss. It has no equity stop either. The method in this guide is for manual trades and for checking the implied risk of any EA's open trade.

How do I find the risk of an EA trade that is already open?

Take the lot size from the Trade tab, then compute lots x contract size x the distance from open price to S/L, plus commission. Example: 0.09 lot x 100 x $15.00 = $135, or 1.35% of a $10,000 account. If there is no S/L, the risk to a stop is undefined; Golden Viper has no equity stop, so its risk is not capped by the EA.

Why does my result differ from an online lot-size calculator?

Usually one of four inputs differs: contract size, the pip or point definition, the currency of the account, or the rounding rule. Working in dollars of price removes the pip ambiguity, and the tick-value cross-check, (stop / tick size) x tick value, should equal stop x contract size. If the two disagree, one of your inputs is wrong.

Does a stop-loss guarantee I lose no more than the computed amount?

No. The formula gives the loss if the stop fills at its price. Slippage in fast markets and gaps can fill it worse. ESMA's retail CFD rules include negative balance protection and a close-out at 50% of minimum required margin, but those are account-level safeguards, not a promise about any single trade, and they apply only to brokers and clients covered by them.

Myfxbook Verified

Automate Your XAUUSD Trading

MT5Hedging cent account
XAUUSDGold only
GridBasket take-profit
Lifetime license $299 one-time
Get Lifetime Access — $299 →
✓ License key by email✓ One MT5 account per key✓ MT5 cent accounts✓ Full setup help
GV

Golden Viper EA

Written by Golden Viper EA, the maker of the Golden Viper EA gold Expert Advisor for MetaTrader 5. We sell the EA, so weigh our product mentions with that in mind; its live account is public on Myfxbook.

Myfxbook VerifiedLive account verified on MyfxbookPublic track record

Let Golden Viper EA trade gold for you

Automated XAUUSD grid trading for MT5 cent accounts, verified live on Myfxbook. One-time $299, lifetime access.

Get Lifetime Access — $299

Start Free 3-Day Trial → · Full setup help