Home / Blog / Margin call vs stop-out: what each level does and how margin…

Margin call vs stop-out: what each level does and how margin level is calculated

In short: In MT5, a margin call is a warning and stop-out is when the broker starts closing your positions itself; the broker sets both levels.

Margin call vs stop-out: 40% example stop-out level: below it the broker starts closing positions; 60% only warns
40% example stop-out level: below it the broker starts closing positions; 60% only warns

A margin call is the margin level at which the broker warns you to add funds or cut positions. Stop-out is the lower level at which the server starts closing positions for you. Margin level is equity divided by margin, in percent. Your broker sets both levels, in percent or in money, so read them from your own account.

The figures are arithmetic of settings, not a forecast, calculated on 8 October 2026 with the same arithmetic as the grid calculator: a cent account with $1,000, an 11-order doubling grid (start lot 0.01, ×2, step $1.95), gold at $4,170, margin call 60%, stop-out 40% (example levels). The stop-out arithmetic article uses the same basket; the cent account article uses another gold price and leverage, so its figures differ.

See also: 7 protections for a martingale grid bot on gold →

On this page (9)

What are balance, equity, margin, free margin and margin level?

Margin level is equity as a percentage of margin, and it sits among five numbers in the Trade tab of MetaTrader 5 (MT5 Help). Balance is the money on the account, open results excluded. Equity is balance plus or minus the floating result (the Help also counts credit, commission and blocked funds). Margin is the money required to cover open positions and pending orders. Free margin is equity minus margin, what is left for new orders.

For the full basket, after the 11th order opens, at 1:2000:

NumberValue, USDWhere it comes from
Balance1,000.00the deposit
Equity960.301,000.00 − 39.70 floating loss
Margin42.6820.47 lots held at 1:2000
Free margin917.62960.30 − 42.68
Margin level2,250%960.30 ÷ 42.68 × 100

A cent account usually shows money in cents (USC): $1,000 reads 100,000.00 USC. The percentage is the same.

How is margin level calculated in MT5? Formula and example

In MT5, margin level, % = equity ÷ margin × 100 (ACCOUNT_MARGIN_LEVEL in MQL5), and free margin = equity − margin. For gold, margin in the simple case is lots × contract size × price ÷ leverage. On a cent account the lot is priced 100 times smaller (usually a 1-ounce contract in the specification; our calculators write it as 100 oz ÷ 100), and the terminal shows the result in cents. Your broker may set it differently, so trust the symbol specification. For the 11th order:

margin       = 20.47 lots × 100 oz ÷ 100 × 4,170 ÷ 2,000 = $42.68 (4,268 USC)
equity       = 1,000.00 − 39.70                           = $960.30
margin level = 960.30 ÷ 42.68 × 100                       = 2,250%

Equity changes on every tick; once the basket is full, margin barely does (it moves about 1% over a $46 move, and the calculator keeps it at the $4,170 price). So each further dollar against the basket takes $20.47 off equity and pulls the margin level down.

What is a margin call, and does MT5 warn you?

A margin call is a warning: the margin level at which the broker treats the account as short of funds and asks you to add funds or cut positions. The MQL5 book calls it the level at which replenishment will be required, a warning only (MQL5 book); in code it is ACCOUNT_MARGIN_SO_CALL. MT5 itself says little: its Help says the account state line in the Trade tab turns red in the Margin Call or Stop Out state, and mentions no other warning. Any email or call is up to the broker.

The level may have a second job. For checking a new position in percent mode, the MQL5 book gives the test (equity − commission) ÷ (margin + margin of the new position) × 100, which must stay above the margin call level. In money mode, equity is compared with it directly. The book offers this as a check to run before opening a position and does not say what the server does when it fails. If your broker enforces it, the next grid order could be refused while the account is still above the stop-out level.

What is the stop-out level in MT5, and who sets it?

The stop-out level is the margin level at which the broker's server starts closing positions by force; the broker sets it, in percent or in money, usually per account type. In MQL5, ACCOUNT_MARGIN_SO_SO is the level and ACCOUNT_MARGIN_SO_MODE is the unit, either ACCOUNT_STOPOUT_MODE_PERCENT or ACCOUNT_STOPOUT_MODE_MONEY (MQL5 reference). Percent mode compares the level with margin level, money mode with equity (build 2340 release notes).

Neither the terminal nor an Expert Advisor sets it; it comes from the broker's server settings, usually per account type. Public numbers are examples: the MQL5 book's sample is 50 for the call and 30 for stop-out. In 2018 ESMA adopted temporary EU measures for retail CFDs, applied from 1 August 2018, with a close-out at 50% of minimum required margin per account (ESMA, 2018). It let them lapse on 31 July 2019 because most national authorities had adopted permanent rules at least as strict (ESMA, 2019). What applies to you depends on the entity you signed with and its regulator. Check that your broker accepts clients from your country.

What does the broker close first, and at what price?

At stop-out the server closes the position with the largest loss first, at whatever price it can get, and that price can be worse than the stop-out line. That is the normal mode, with the FIFO rule off, as the Help puts it. With the rule on, the server takes the oldest losing position of each symbol and closes the greatest loser among them. The build 2340 release notes put it more bluntly: at the stop-out level all orders are cancelled and all positions are closed.

In a doubling grid the newest order is the biggest loser (10.24 lots against 5.12), so it goes first. The Help does not say how many positions go per pass, so ask your broker what its server does. The example assumes it closes one position and re-checks. At 1:2000 stop-out begins at $4,104.42, with equity at $17.07 and about $472 of floating loss on that order. Closing it halves the margin, margin level jumps from 40% to about 80%, and closing pauses until price falls another $0.83. At 1:100 the pause is $16.70.

The price of each close is whatever the server gets, not the line in the table. Gaps and slippage can make it worse; see can a forex account go negative.

Does a high margin level mean a grid is far from stop-out?

No. A high margin level in MT5 does not show room for a grid: margin level counts equity in units of margin, and leverage shrinks that unit. It is like measuring the distance to a cliff in shoe lengths: smaller shoes, bigger count, same cliff. The same basket at three leverages:

LeverageMargin heldMargin level at the 11th orderRoom to margin call (60%)Room to stop-out (40%)Equity when stop-out starts
1:100$853.60112.5%$21.89$30.23$341.44
1:500$170.72562.5%$41.91$43.58$68.29
1:2000$42.682,250%$45.66$46.08$17.07

Room is dollars of gold price below the 11th order, which sits $19.50 under the first one.

Margin level differs 20 times across the table; room differs 1.5 times. Even with zero margin, room could not pass equity ÷ dollars per $1 of price: 960.30 ÷ 20.47 = $46.91. At 1:2000 the margin call comes only $0.42 of gold before stop-out. And the gauge looks calm until late: after a further $20 decline it reads 1,291%, after $40 it reads 332%, after $46 it reads 44% (the first 0.01-lot order alone reads about 4.8 million percent).

The number that works is room in dollars:

room = (equity − stop-out % × margin) ÷ (dollars per $1 of price)

The stop-out percentage matters less than it seems. At 1:100, levels of 20%, 40% and 50% leave $38.57, $30.23 and $26.06 of room; at 1:2000, $46.50, $46.08 and $45.87. High leverage does not shrink the loss: the broker steps in when $17.07 of the $1,000 is left at 1:2000, and when $341.44 is left at 1:100.

How do you find your own margin call and stop-out levels in MT5?

Read them from two places: the broker's account terms (levels can differ by account type, and the legal entity matters) and the terminal, which shows what the server reports. In the terminal:

  1. In MetaEditor create a script (File → New → Script) and paste the code below.
  2. Press F7 to compile it.
  3. Drag the script onto any chart.
  4. Open the Experts tab and read the levels and their unit (percent or money).
void OnStart()
{
   ENUM_ACCOUNT_STOPOUT_MODE mode =
      (ENUM_ACCOUNT_STOPOUT_MODE)AccountInfoInteger(ACCOUNT_MARGIN_SO_MODE);
   Print("Level unit: ", EnumToString(mode));
   Print("Margin call level: ", AccountInfoDouble(ACCOUNT_MARGIN_SO_CALL));
   Print("Stop-out level: ", AccountInfoDouble(ACCOUNT_MARGIN_SO_SO));
   Print("Leverage 1:", AccountInfoInteger(ACCOUNT_LEVERAGE));
   Print("Margin level now: ", AccountInfoDouble(ACCOUNT_MARGIN_LEVEL), "%");
}

A demo of the same type may be set differently from live, so run it on the account you will trade. The cent account article linked above prints more fields, and the margin calculator turns your numbers into margin and room for one position.

What can go wrong?

A martingale-style grid keeps adding size while price moves against it, and a long enough move reaches stop-out. Trading with leverage carries risk: if the deposit is too small, a stop-out is possible. Size your deposit with a safety margin. The tables leave out spread, swap, commission, slippage, gaps, and the fact that some brokers change leverage with the balance, over the weekend or near news. Any of them can bring the real stop-out closer. Levels differ between brokers and can change. A margin call is a warning; it does not make the next price move smaller.

Midas is an Expert Advisor for MetaTrader 5 that trades gold with a grid like this. Its panel shows a "room to stop-out" estimate, not a promise, and its optional one-order lock does not prevent a stop-out (Risk, plainly). Terms such as basket and lock are in the grid EA glossary.

This is arithmetic of the settings, not a forecast. Trading with leverage carries risk: if the deposit is too small, a stop-out is possible. Size your deposit with a safety margin. Nothing here is individual investment advice.

Midas · figures calculated and sources retrieved on 8 October 2026.

FAQ

What is the difference between a margin call and a stop-out in MT5?

A margin call is a warning: the margin level at which the broker considers the account short of funds. Stop-out is a lower level at which the server starts closing positions by force. As equity falls, margin level reaches the margin call level first, then the stop-out level. Both are set by the broker, in percent or in money; read yours from your account.

What does stop out level mean in MT5, and how do I find mine?

It is the level at which MT5 starts closing positions on its own. In percent mode it is a margin level: with a 40% stop-out level, closing starts when equity falls to 40% of margin. In money mode it is an equity amount. Find yours in the broker's account terms, or run the short MetaEditor script given in this article, which prints it in the Experts tab.

What is margin level in forex, and does a high one mean there is room?

Margin level is equity as a percentage of used margin: equity ÷ margin × 100. With $960.30 of equity and $42.68 of margin it is 2,250%. It shows how many times equity covers the margin held, not how far price can move. With high leverage the margin is small, so the number can look large while the room in dollars of price is short.

Does 1:2000 leverage change where stop-out happens or reduce risk?

Leverage lowers the margin the broker holds, not the loss from a price move. In the example, going from 1:100 to 1:2000 raises the room before stop-out from $30.23 to $46.08 of gold price, while the equity left when stop-out starts falls from $341.44 to $17.07; the loss per $1 of price is the same. Balance, lots and the grid step also decide the distance.

Does MT5 warn you before a margin call or stop-out?

MT5 itself warns very little. Its Help says the account state line in the Trade tab turns red in the Margin Call or Stop Out state, and it mentions no other warning. Any email or phone call is up to the broker. A margin call is a warning only; it does not make the next price move smaller.