Free Guide 0.2

Leverage, Margin and Margin Calls

When an Expert Advisor (EA) opens a trade, your broker sets aside part of your money as a deposit for it. That deposit is the margin, and leverage decides how big it is. Neither one decides how much you lose if the trade goes wrong. This page explains what they do decide, how MetaTrader 5 (MT5) works out the margin for a trade, and what happens when an account runs short of it.

Leverage

Leverage is shown as a ratio, such as 1:30 or 1:100. On a currency pair, 1:100 means a trade needs a deposit of one hundredth of its size.

The broker sets the leverage for each account, from the choices it offers for your country and account type, and can charge more margin on particular symbols (see margin rate, below), which works like a lower leverage on those symbols. When you open a demo, you pick it from what's offered, so a demo's leverage can differ from the live account you'd actually use. Note both.

What leverage changes: the margin a trade needs, so how many trades fit in your account, and how far the account can fall before the broker starts closing trades.

What it doesn't change: the money a trade gains or loses per pip. That comes from the lot size and the pip value (page 0.1). A 0.40-lot trade loses the same amount per pip at 1:30 as at 1:100.

Margin for One Trade

MT5 works out the margin from the symbol's calculation mode, which you'll find in the symbol's Specification window. The common ones (formulas from the MT5 help, per lot traded):

Calculation mode Margin for one lot, before conversion and margin rate
Forex contract size ÷ leverage
Forex No Leverage contract size
CFD, Exchange Stocks contract size × market price
CFD Leverage contract size × market price ÷ leverage
CFD Index contract size × market price × tick price ÷ tick size
Futures and exchange futures the symbol's initial margin to open a position; its maintenance margin, if the broker sets one, to keep it open

The MT5 help calls the three CFD modes Contracts, Contracts Leverage and Contracts Index; the MQL5 reference calls them CFD, CFD Leverage and CFD Index. They're the same modes. A few other modes (bonds, for example) have their own formulas, listed in the MT5 help.

Three more steps turn that into the figure that matters:

  1. Fixed margin. If the Specification window shows a non-zero Initial margin, MT5 uses that amount per lot instead of the formula. In the Forex and CFD Leverage modes, it's still divided by your leverage. An Initial margin of 0 or blank means MT5 calculates the margin from the formula.
  2. Conversion. The result is in the symbol's margin currency (usually the first currency of a pair). MT5 converts it into your account currency at the current rate.
  3. Margin rate. The broker can multiply the converted figure by a margin rate. The rate can differ by symbol, by direction or by how much you trade, so the margin for one symbol can be higher than your account's leverage suggests.

The result is the final margin for one lot, in your account currency. That's the figure to write down. The Initial margin field on its own is never that figure. Two cautions: margin rates can rise with the volume you hold, so check the rate at the size you'd trade; and once there's more than one position or order on a symbol, MT5 recalculates the margin for all of them together (opposite trades, for example, are charged by the broker's hedged-margin rule), so the Trade tab's Margin figure is the one that counts, not lots times the one-lot figure.

Example (Illustrative): EURUSD, Forex mode, contract size 100,000 euros, leverage 1:100, a dollar account, margin rate 1.

  • 100,000 ÷ 100 = 1,000 euros for one lot.
  • Converted at 1.0850: 1,085 dollars for one lot.
  • The 0.40-lot trade from page 0.1 needs 0.40 × 1,085 = 434 dollars.
  • At 1:30 instead, the same trade needs about 1,447 dollars. Its loss at the 25-pip stop is still 100.

On a hedging account, a buy and a sell held together on the same symbol may be charged less margin than the two separately. How much less is the broker's setting.

Balance, Equity, Free Margin and Margin Level

MT5's Trade tab shows these on one line:

  • Balance: the money in the account, not counting open trades.
  • Equity: the balance plus or minus the profit or loss on open trades (and any credit, less commission, as MT5 defines it).
  • Margin: the money set aside for open positions and pending orders.
  • Free margin: equity minus margin. It's what's left to open new trades. With nothing open and no credit, free margin equals the balance.
  • Margin level: equity ÷ margin × 100, shown as a percentage.

In the example: equity 10,000, margin 434, so free margin is 9,566 and the margin level is about 2,304%.

Margin Call and Stop Out

The broker sets two levels for every account, either as a margin-level percentage or as an amount of money:

  • Margin call: a warning level. MT5 highlights the account line in red.
  • Stop out: if the account falls to this level, the broker's server starts closing positions, usually the one with the largest loss first. How many it closes is the broker's setting: it may keep closing until the margin level is back above the stop-out level, or close more. On accounts with a first-in-first-out rule, the server instead looks at the oldest position on each symbol and closes whichever of those has the largest loss.

A stop out is not a stop loss. A stop loss is a level you set on one trade. A stop out is the broker closing your trades because the account can't carry them, at whatever loss they're showing.

Example (Illustrative): with a stop out at 50%, the account above would reach it when equity falls to 217 (50% of 434). The 0.40-lot trade loses 4 per pip, so that's a fall of roughly 2,446 pips. With a 25-pip stop on the trade, the stop closes it long before margin matters.

Why This Matters for an EA

For an EA with a stop on every trade, sized from your risk, leverage mostly decides how many trades fit. For an EA that adds trades without a stop, such as a grid or martingale, the stop out is often where the losing run finally ends, and it can take most of the account. That's why the number to check is the total loss an EA could carry, not the leverage.

MT5 details checked against MetaQuotes' MetaTrader 5 help and MQL5 reference, October 2026. Examples are illustrative; read your own broker's figures.

Trading involves risk. Only trade with money you can afford to lose. This page is educational and is not financial advice.

The Robotic Trader Logo

© 2026 The Robotic Trader. All rights reserved.