The Margin Equation: Every Formula You Need
Every leveraged position lives or dies by a handful of equations. Know them and you can read your account at a glance; ignore them and a stop-out will explain them for you.
The five terms you need to know
Before the formulas mean anything, the variables have to be nailed down. These five show up in every broker platform, usually with identical names:
| Term | What it actually is |
|---|---|
| Balance | Cash in the account, not counting open P&L |
| Equity | Balance + floating profit/loss on all open positions |
| Used margin | Margin the broker has locked as collateral for open positions |
| Free margin | Equity still available to open new positions or absorb losses |
| Margin level | Equity expressed as a percentage of used margin |
Balance is static between trades. Equity breathes with every tick. Everything else flows from those two facts.
The core equations
Equity
Equity = Balance + Floating P&L
When your trades are flat, Equity equals Balance. The moment you carry an open position, Equity moves. A $5,000 account running a trade currently up $200 has $5,200 of equity. Down $400, it has $4,600.
Used margin (required margin)
Used Margin = Notional Value × Margin Rate
or equivalently:
Used Margin = Notional Value ÷ Leverage Ratio
For a single forex position, notional value is lot size × current price. A standard lot of EUR/USD at 1.0850 has a notional value of $108,500. At 1% margin (100:1 leverage), the broker locks $1,085 as used margin. Open three of those positions and the used margin triples to $3,255.
Free margin
Free Margin = Equity − Used Margin
This is the number that tells you how much cushion you actually have. It is not your account balance. If equity is $5,200 and the broker has locked $3,255, your free margin is $1,945 — that is the remaining buffer before the margin level alarm goes off.
Margin level
Margin Level % = (Equity ÷ Used Margin) × 100
Brokers use this single percentage to decide when to send warnings and when to close positions. A margin level of 200% means equity is twice the required margin — healthy. A margin level of 105% means equity barely covers the collateral — dangerous.
A complete worked example
Starting numbers: a forex account with a $10,000 balance and two open positions.
Position A: 1 standard lot EUR/USD at 1.0850, 1% margin
Position B: 1 standard lot GBP/USD at 1.2700, 1% margin
Step 1 — calculate used margin for each position:
EUR/USD: 100,000 × 1.0850 × 0.01 = $1,085
GBP/USD: 100,000 × 1.2700 × 0.01 = $1,270
Total used margin = $2,355
Step 2 — assume the account is currently running a combined floating loss of −$450:
Equity = $10,000 + (−$450) = $9,550
Step 3 — free margin and margin level:
Free Margin = $9,550 − $2,355 = $7,195
Margin Level = ($9,550 ÷ $2,355) × 100 = 405.7%
At 405.7% the account is in comfortable territory. Now walk the loss to −$8,700:
Equity = $10,000 − $8,700 = $1,300
Free Margin = $1,300 − $2,355 = −$1,055 (negative — no room to open trades)
Margin Level = ($1,300 ÷ $2,355) × 100 = 55.2%
Most retail forex brokers stop out positions automatically somewhere between 50% and 100% margin level. At 55.2% the account is at or near that threshold — the broker will start closing positions, typically largest-loss-first, until margin level rises back above the stop-out floor.
Check your own numbers without working through the algebra each time:
Margin level thresholds: what the percentages mean
Brokers set two alert levels. Exact numbers vary — always check your broker's margin documentation — but the pattern is consistent:
| Margin level | Typical broker action |
|---|---|
| > 200% | Comfortable — room to add positions or absorb movement |
| 100–200% | Caution zone — equity is covering margin but cushion is shrinking |
| ~100% | Margin call warning — broker alerts you to add funds or reduce exposure |
| 50–100% | Stop-out risk — broker may close positions automatically |
| < 50% | Active stop-out — positions closed until level recovers |
The margin call level and stop-out level are different triggers. A margin call (~100%) is a warning. A stop-out (50–100%) is automatic liquidation. Some brokers skip the warning and go straight to stop-out.
How margin requirement is quoted
Brokers express the same requirement three ways. They are mathematically identical:
Margin rate (%) = 1 ÷ Leverage ratio × 100
Examples:
50:1 leverage → 2% margin rate
100:1 leverage → 1% margin rate
200:1 leverage → 0.5% margin rate
500:1 leverage → 0.2% margin rate
A broker advertising "500:1 leverage" is saying they require 0.2% of notional as collateral. That sounds small until you hold a $500,000 notional position and a 0.2% move against you wipes the margin.
Maintenance margin versus the forex margin equation
The margin level equation above is how most forex and CFD brokers manage open positions in real time. It is continuous — the percentage moves every tick.
Stocks and futures use a different model: a fixed maintenance margin dollar threshold below which you get a margin call and must top up to the initial level. If you trade equities or futures and want the full derivation including the margin-call trigger price, the maintenance margin formula explained here covers that model in detail.
The concepts are related but the mechanics differ. Know which model your broker uses before you assume one formula applies.
The margin equation and position sizing
Free margin tells you what you can trade; it says nothing about what you should trade. A $7,000 free margin balance does not mean a $700,000 notional position is a sound idea, even if the leverage allows it.
Two tools that work alongside the margin equation:
- Position Size Calculator — sizes a trade to a fixed percentage of account equity, independent of how much buying power the broker offers.
- Drawdown Calculator — shows how many consecutive losses at a given risk percentage it takes to reach a specified account decline. Useful for stress-testing before you set position size.
The margin equation tells you the wall. Proper sizing is what keeps you away from it. A position sized at 1% account risk at 100:1 leverage will almost never trigger a margin call; a position sized at "whatever the free margin allows" often will.
Using the Margin Calculator in practice
The Margin Calculator at /tools/margin/ runs these equations forward and backward. Enter a lot size and it returns used margin, free margin, and margin level. Adjust equity or lot size and watch margin level move in real time.
The practical use case before entering a trade: set the calculator to reflect your current account state, then model the new position. If adding it drops margin level below 200%, the position is oversized relative to account equity — consider reducing size or waiting until equity recovers.
Disclaimer
This is an educational article, not investment or trading advice. Margin rules — including required margin rates, margin call levels, and stop-out thresholds — vary by broker, instrument, and regulatory jurisdiction. Always confirm the exact terms with your broker before trading. Trading on margin amplifies both gains and losses and can result in losses exceeding your initial deposit.
Run your own numbers
Open the Margin Calculator and apply this to your account.
Open Margin CalculatorCommon questions
- What is the margin level formula?
- Margin Level % = (Equity ÷ Used Margin) × 100. Brokers use this percentage to trigger margin call warnings (typically around 100%) and automatic stop-outs (typically 50–100%).
- What is free margin?
- Free Margin = Equity − Used Margin. It is the portion of your equity not locked as collateral, available to open new positions or absorb further losses. It is not the same as your account balance.
- How is used margin calculated in forex?
- Used Margin = Notional Value × Margin Rate, where Notional Value = lot size × current price and Margin Rate = 1 ÷ leverage ratio. At 100:1 leverage a standard EUR/USD lot at 1.0850 requires $1,085 in used margin.
- What is the difference between a margin call and a stop-out?
- A margin call (usually triggered around 100% margin level) is a warning to add funds or reduce positions. A stop-out (typically 50–100%) is automatic liquidation by the broker — no warning, positions are closed until margin level recovers. Some brokers skip the call and go straight to stop-out.