Risk management

Margin Level in MT4 and MT5: Formula, Free Margin and Stop Out

A positive balance does not tell you how much equity supports your positions. Connect the account figures, calculate margin level and see what changes when a losing position closes.

Author · Editor

Reviewed

Two blue glass panels around a teal stone block, with a brass bar alongside on a pale surface.

The essentials

  1. Margin level compares equity with used margin: Equity ÷ Margin × 100. It is a percentage, not the amount of money available to trade.

  2. A positive balance can coexist with falling equity and negative free margin. Account thresholds and their units determine how those figures are used.

  3. Closing a position realizes its existing profit or loss. In a simple example without new costs, equity does not rise just because margin is released.

What does margin level mean in MT4 and MT5?

Margin level expresses account equity as a percentage of used margin. When used margin is greater than zero, the formula is Equity ÷ Used Margin × 100. With $800 of equity and $200 of used margin, the result is 400%: equity is four times the margin requirement.

The percentage is a relationship between two account values. It is not your return, the percentage of balance you have lost, or a universal safety score. For the same equity, a larger margin requirement produces a lower margin level. A ratio can therefore change even when the open trade's profit or loss (P/L) has not changed.

MetaTrader 5's account-state documentation gives the equity-to-margin formula, while the MT4 account-property reference identifies margin level as a percentage. The platform displays account settings supplied by the broker; the names MT4 and MT5 do not establish one common stop-out threshold.

Calculate margin level from equity and used margin

Use the current Equity and Margin figures from the same account snapshot and currency. Do not substitute balance for equity, or the full position value for used margin. The example below uses USD and starts with $800 equity and $200 used margin.

It calculates margin level as 800 ÷ 200 × 100 = 400% and free margin as 800 − 200 = $600. The free-margin result uses the simplified Equity − Margin relationship; terminal and server settings can affect the available amount. If your terminal differs, check the calculation rules rather than changing an input just to force a match.

Thresholds are off initially. Percentage mode introduces hypothetical 100% and 50% figures, which you can replace with your account's documented values. It reports whether the current ratio is above, exactly at or below each number. Monetary mode explains the limit of this calculation instead of treating a currency amount as a percentage.

Try it yourself

Read the account row

Calculate margin level and free margin

Start with equity of 800 USD and used margin of 200 USD: margin level is 400%, and calculated free margin is 600 USD. Change either value to see their relationship.

Educational USD example · no connection to a trading account

Use the current account equity, not balance. Negative values are retained.
Use the account's margin requirement, not free margin or position value.

Calculated free margin

600.00 USD

800.00 − 200.00 = 600.00 USD

Margin level

400%

800.00 ÷ 200.00 × 100 = 400%

Here free margin is calculated as equity − used margin. Terminal and server settings can produce a different available amount.

Choose the mode stated in your account conditions. A platform name alone does not establish it.

No margin-call or stop-out level is assumed. The account arithmetic is shown without a broker-action verdict.

Assumptions and limits

Inputs use one currency, USD. The component does not rebuild equity from balance, price feeds, credit or blocked funds. It calculates E − M as a simplified free-margin relationship and E ÷ M × 100 when M is positive. Percentage checks hold margin constant and do not simulate a broker's liquidation engine, execution, pending-order requirements or future margin changes.

≈ marks a percentage rounded to six decimals. Threshold comparisons use exact amounts, not the rounded percentage.

Threshold amounts can show up to six decimals so fractions of a cent are not hidden.

Equity: 800.00 USD. Calculated free margin: 600.00 USD. Margin level: 400%.

Read Balance, Equity, Margin and Free Margin together

Field

What it describes

In the simple example

Balance

The booked account balance; the open position's current P/L is separate

$1,000

Equity

The current account value after the applicable adjustments

$1,000 + (−$200) = $800

Margin / Used Margin

The account's current margin requirement

$200

Free Margin

The amount remaining under the applicable free-margin calculation

$800 − $200 = $600

Margin Level

Equity relative to used margin, expressed as a percentage

$800 ÷ $200 × 100 = 400%

Scroll sideways to compare all columns ↔

For this example, equity equals balance plus one open P/L. A real account can be more complicated. MT5 documents credit, commission and blocked amounts in its account-state calculation; exchange accounts can also use a different asset and liability model. Start from the displayed equity when checking the ratio instead of reconstructing every account as Balance + Profit.

Free margin also needs context. MQL4 documents different ways to include floating profit and loss when calculating funds available to open orders. That is why the teaching formula is not a promise that every configured account will expose the same available amount. Free margin is also not automatically a withdrawable cash balance.

  • MT4 desktop: open the Terminal window and its Trade tab. The account summary appears with the current positions and pending orders.
  • MT5 desktop: use the Trade tab in Toolbox and inspect the account-state line alongside the positions.
  • These are desktop locations. Mobile and web layouts differ; use the help for your particular application instead of assuming the desktop panel name appears there.

The desktop locations are documented separately in MT4 Trade help and MT5 trading help. Field labels may be translated in your application. The MT5 exchange-margin documentation explains why the simple retail-style example should not be copied to every exchange account.

What do 100%, 50% and zero free margin mean?

Keep balance at $1,000 and used margin at $200, and change only the open P/L. With no other adjustments, the same account moves through these mathematical states. The table does not simulate automatic liquidation or claim that a broker would allow every state to persist.

Open P/L, USD

Equity, USD

Calculated free margin, USD

Margin level

−200

800

600

400%

−800

200

0

100%

−900

100

−100

50%

−1,000

0

−200

0%

−1,100

−100

−300

−50%

Scroll sideways to compare all columns ↔

At 100%, equity equals used margin; calculated free margin is zero in this model. At 50%, equity covers half the margin requirement, even though the balance still shows $1,000 and equity remains positive. Negative free margin therefore does not necessarily mean negative equity.

At zero equity with positive margin, the ratio is 0%. That is different from zero used margin, where division by zero makes the ratio undefined. The examples retain negative values instead of disguising them as zero. None of these numbers, by itself, establishes the account's liquidation procedure or the amount a client may ultimately owe.

Margin call vs stop out: the account rules matter

A margin call is a margin-related warning or account state; stop out is forced closing under the account's rules. Do not assume a margin call means a personal telephone call, a guaranteed response period or a chance to add funds before any closure. Check the actual notification and execution terms.

The MQL5 account properties separate the margin-call figure, stop-out figure and their percentage or monetary mode. MT4's stop-out mode documentation also distinguishes percentage and absolute-value calculations. A figure of 50 in account conditions is incomplete until its unit and comparison basis are known.

Monetary rules are not one shared MT4/MT5 formula. The MT4 reference describes a comparison involving free margin, while the MQL5 margin-settings example uses equity for its monetary mode. The component deliberately does not evaluate monetary stop-out conditions. Use the rules for the actual account and server configuration.

  • Identify the percentage or monetary mode, the values and the relevant account or product scope.
  • Check what happens exactly at the threshold: reaching a value and falling below it need not use the same comparison rule.
  • Check which positions or orders can be affected, the closure sequence and execution conditions. A ratio calculator cannot infer that process.

For a hypothetical 50% reference with used margin fixed at $200, the corresponding equity is 200 × 50 ÷ 100 = $100. At current equity of $800, the arithmetic difference is $700. This is not a guaranteed amount you can lose: margin requirements, fees and prices can change, and execution can occur at a different price after a threshold is crossed. The slippage guide explains the distinction between a reference price and an actual fill.

What changes when the losing position closes?

The next example has exactly one position, no credit or blocked funds, no pending-order margin, no other positions or portfolio offsets, and no additional closing costs. Its open P/L is the modeled change relative to the entered balance. A charge already reflected in balance must not be included again in that P/L.

At the starting −$200 P/L, closing moves balance from $1,000 to $800 while equity stays $800. Used margin falls from $200 to zero, so calculated free margin rises from $600 to $800. Releasing margin changes availability; it does not recover the $200 loss or create new equity.

Choose the 50% example and close its single position. Before closing, equity is $100 and calculated free margin is −$100. Afterwards, balance and equity are $100, margin is zero, free margin is $100 and margin level is shown as a dash. The before-and-after table keeps the original figures visible, and the same P/L is transferred only once.

Try it yourself

One position, one account

See what changes when a position closes

Change the open P/L or used margin, then close the example position. The ledger shows where the P/L goes and why closing alone does not restore lost equity.

Simplified single-position account · no other margin requirements or new closing costs

Explore a starting state
Before-close inputs
The already-booked account balance. It stays unchanged while the position remains open in this model.
The position's modeled change relative to the entered balance. Do not include a charge again if it is already in balance.
In this example, all used margin belongs to the one position being closed.

Example position is open

Account before and after closing · amounts in USD except margin level
Account valueBeforeAfter
Balance1,000.00—
Open P/L-200.00—
Equity800.00—
Used margin200.00—
Free margin600.00—
Margin level400%—

Close the example position to fill the After column.

Equity before: 1,000.00 + (-200.00) = 800.00 USD

These scenarios are not automatic liquidations. A positive balance, a 50% level or zero free margin does not by itself determine the broker's next action.

Assumptions and limits

Equity = entered balance + modeled open P/L. There is one position, no credit, blocked funds, pending-order margin, portfolio offsets, other positions or additional closing costs. P/L contains only changes not already reflected in balance. Closing transfers that P/L to balance exactly once, leaves equity unchanged and releases this position's entire margin. Real execution prices, fees and account rules can change the actual outcome.

Before closing: equity 800.00 USD, free margin 600.00 USD, margin level 400%.

Why can margin level fall without a new realized loss?

There are two sides to the ratio. Equity can fall as open positions lose value or applicable charges are recorded. Used margin can rise because exposure or the applicable requirement changes. For example, keeping equity at $800 while changing margin from $200 to $400 lowers margin level from 400% to 200% and calculated free margin from $600 to $400.

Leverage, contract rules, currency conversion and account arrangements can affect the requirement. A lower margin requirement for unchanged exposure does not make the same market-price movement produce a smaller trading loss. Margin is collateral required by the account rules; it is neither a commission nor a maximum-loss limit.

On a real multi-position account, closing one trade does not necessarily release all margin. Pending orders may still require funds, and hedged or portfolio positions can be recalculated after a close. The single-position exercise sets margin to zero only because it excludes those other requirements.

Keep transaction costs separate from collateral. The Forex Spread Calculator estimates spread and commission costs, not account margin level. When reconciling an actual statement, do not subtract a spread again from P/L already calculated using fill prices, or count a commission twice because it appears in more than one account view.

Troubleshoot missing or unexpected account figures

  • No open positions, but some margin remains: check pending orders and any other account requirements before assuming Margin must be zero.
  • Margin is zero: the percentage has no denominator. A blank field or dash must not be read as a safe 0% or an unlimited margin buffer.
  • Free margin is negative while balance is positive: compare equity with the requirement and inspect the open P/L; balance alone does not describe the current account value.
  • A manual calculation differs from the terminal: use figures from the same snapshot and currency, then check credit, booked or blocked charges, floating-result recognition and the account calculation model.
  • An order is rejected despite positive free margin: available funds are only one condition. Check the additional requirement for that order and the platform's rejection message; instrument and account restrictions can also matter.

If the account shows negative equity or balance, the arithmetic does not tell you whether a loss will be adjusted or what legal liability remains. Negative balance protection is a separate question about the applicable account terms and protections. A stop-out setting and negative balance protection are not interchangeable.

Use margin level as an account check, not a trading target

  • Read equity and used margin together, with the current open P/L and the account currency.
  • Confirm the account's actual threshold units, values, comparison conditions and closure process; keep the terms dated.
  • Explore a change in P/L and a change in margin separately. A percentage that looks comfortable in one snapshot can move for either reason.
  • Keep position-risk planning separate from margin availability. Check the possible money loss, execution uncertainty and total exposure rather than sizing a trade to use every available unit of margin.

The Position Size Calculator connects a chosen money-risk budget and stop distance to a trade size. This article answers a different question: how the current account values relate to its margin requirement. Neither the displayed margin level nor a positive free-margin amount proves that a proposed trade fits your risk plan.

There is no universal safe margin level of 100%, 200% or 500%. The relevant context includes the account rules, the positions, changing requirements and how quickly equity can move. The interactive scenarios explain the arithmetic; they do not recommend adding funds, increasing leverage or waiting for a particular ratio before acting.

Margin level in MT4 and MT5: common questions

Is margin level the same as free margin?

No. Margin level is a percentage: Equity ÷ Margin × 100 when margin is positive. Free margin is a money amount under the account's calculation rules; the simple model here uses Equity − Margin. Comparing 400% with $600 without identifying the units mixes two different measures.

Does 100% margin level automatically close my trades?

No universal rule follows from 100%. It means equity equals used margin. Whether a warning, restriction or closure follows depends on the account's thresholds, mode and execution rules. Zero calculated free margin is not, by itself, an instruction to close all positions.

Is a margin level above 200% safe?

The number alone cannot establish safety. It describes the current ratio, not future price changes, gaps, new charges or changes in margin requirements. Check the account rules and the risk of the actual positions instead of treating any percentage as a guarantee.

Why is margin level blank when I have no open trades?

If used margin is zero, dividing equity by it does not give a defined percentage, so a blank field or dash is understandable. Confirm that margin really is zero: pending orders or other requirements can remain even without an open position. The blank field is not a safety rating.

Can free margin be negative while equity is positive?

Yes in the simple Equity − Margin model. Equity of $100 and used margin of $200 give −$100 free margin and a 50% margin level. This state is different from negative equity and does not, by itself, identify the broker's stop-out rule.

Does closing a losing position restore equity?

Closing realizes the existing loss; it does not erase it. Without price changes or new costs, the example transfers the open P/L into balance once and leaves equity unchanged. The release of margin can increase free margin, while actual execution costs or other requirements can change the real outcome.

Sources & further reading

All guides
Position Size CalculatorRelate a chosen money-risk budget and stop distance to position size.Negative balance protectionSeparate account liquidation rules from protections after a negative balance.Slippage explainedDistinguish a reference price from the price of an actual execution.Forex Spread CalculatorEstimate spread and commission costs separately from margin requirements.
All guides