Glossary

Stop Out Level in MetaTrader 5: When Positions Are Closed by Force

At a glance

The stop out level is the account threshold at which MetaTrader closes the most unprofitable position by force. It is compared with the margin level, which is equity divided by margin, in percent. The broker sets the threshold, either in percent or in money, together with a separate margin call level. An Expert Advisor does not change it; it can only read it.

On this page

The stop out level is the margin level at which the account’s most unprofitable position is closed by force. Your broker sets it. An EA can read the value but cannot move it.

The MetaQuotes documentation was checked on 1 October 2026. AI assisted with research and drafting. RoboXpert develops its own trading software, so we have a commercial interest in this subject; see our editorial standards and commercial disclosure.

What the stop out level is compared with

MetaTrader shows a margin level for the account. The help describes it as the “percentage of the account equity to the margin volume”, which is equity ÷ margin × 100.

Two thresholds belong to it. MetaQuotes’ programming guide defines them as follows:

Scroll horizontally if needed

ThresholdMetaQuotes’ description
Margin call“The minimum margin level at which account replenishment will be required”
Stop out“The minimum margin level at which the most unprofitable position will be forced to close”

Percent or money: check the stop out mode

The same number can mean two things. According to the account properties, both thresholds are “expressed in percents or in the deposit currency”, depending on the account’s stop out mode. A value of 50 is a 50% margin level in one mode and 50 units of the deposit currency in the other.

Where to read the stop out level

The Trade tab shows balance, equity, margin, free margin and the current margin level. The two thresholds are account settings made by the broker. A script can read them from the connected account:

Print("Stop out mode: ", EnumToString((ENUM_ACCOUNT_STOPOUT_MODE)AccountInfoInteger(ACCOUNT_MARGIN_SO_MODE)));
Print("Margin call level: ", AccountInfoDouble(ACCOUNT_MARGIN_SO_CALL));
Print("Stop out level: ", AccountInfoDouble(ACCOUNT_MARGIN_SO_SO));

These lines come from our read-only script, which compiled with zero errors and zero warnings on 1 October 2026. We did not run it on an account, so we show no output. An offline terminal can return defaults; read the values on the account you will trade.

Reader resource · ZIP

Read these values on your own account

A read-only MQL5 script that prints the properties named in this glossary, with its compiler record. It sends no order.

Download the read-out script

A hypothetical example: when a 50% stop out level is reached

Take the account from our lot size guide: $500 of equity and $366.67 of margin give a margin level of about 136%. Assume a stop out level of 50% in percent mode. That figure is an assumption for the arithmetic, not a typical or recommended value.

With the margin unchanged, the threshold is reached when equity falls to $183.34, because 183.34 ÷ 366.67 × 100 is about 50%. The open positions would have to lose $316.66. If the EA opens further positions on the way down, the margin rises and the threshold is reached earlier.

Why the stop out level matters for an EA

  • Position-adding systems. A grid or martingale EA raises the margin with every entry while open losses lower the equity. Both push the margin level down. Our grid and martingale guide models such a path.
  • Several EAs. The margin level is one figure for the whole account. Separate magic numbers do not create separate margin pools.
  • Other loss limits. A prop firm’s daily or maximum loss rule is a different rule with its own calculation. Passing one says nothing about the other.
Friendly robot illustration representing the RoboXpert pen name.
AI-generated avatar

About the author

RoboXpert

Pen name

The person behind RoboXpert writes about expert advisors, trading evidence and programming, and develops their own trading software. They report 10 years of experience in these areas; this is self-reported, not an independently verified qualification or performance record.

Sources & further reading

Your next question

Continue reading

Expert advisors

EA Lot Size Explained: Fixed Lot, Risk Percent and Capital Needed

Work out what a lot setting costs in margin and in money before the account gets near a threshold.

Read the guide →
Expert advisors

Grid Trading vs Martingale: How Forex EAs Increase Risk

See how added positions raise the margin while losses lower the equity.

Read the guide →