Forex margin calculator with margin level and stop-out
Enter the instrument, your lot size and your leverage. The margin, the margin level and the distance to a stop-out update as you type.
On this page
Margin is the deposit your broker sets aside to keep a trade open: the position’s value divided by the leverage, in your account currency. On a USD account, 0.50 lot of EURUSD at 1.13550 with 1:30 leverage needs $1,892.50 of margin.
The calculator above does this for 28 currency pairs, gold, silver, four index CFDs and bitcoin, in 16 account currencies. With your equity it also shows the free margin, the margin level, the effective leverage and how far price can move against the position, long or short, before a stop-out. It is a risk check, not a tool for finding the most you can open.
How it works
- Margin. MT5 works it out by the symbol’s calculation mode, listed as Calculation in its Specification window (right-click the symbol in Market Watch, then Specification): Forex, CFD, CFD Leverage or CFD Index. A non-zero Initial margin there replaces the formula with a set amount per lot.
- Notional value and effective leverage. The full value of the position, and that value divided by your equity. This is the leverage you are actually running, whatever the account allows.
- Free margin and margin level. Equity minus margin, and equity divided by margin.
- Distance to the stop-out. The price at which the margin level falls to your broker’s stop-out level, for a long and for a short, in pips and as a price.
If the margin is first worked out in another currency, one exchange rate converts it. The rate is shown with its date and you can type today’s price.
The margin formula
MT5’s margin formulas by calculation mode:
Forex lots × contract size ÷ leverage
CFD Leverage lots × contract size × price ÷ leverage
CFD lots × contract size × price × margin rate
CFD Index lots × value per point × price × margin rate
Per lot lots × margin per lot
margin level = equity ÷ margin × 100
free margin = equity − margin
stop-out at equity + running result
= stop-out % × margin
Forex gives the margin in the base currency and the CFD modes in the quote currency; either is then converted into your account currency. Dividing by the leverage is the same as multiplying by a margin rate: 1:30 is a 3.33% margin, 1:20 is 5%. The calculator’s CFD mode covers CFD and CFD Leverage: enter your leverage, or the symbol’s margin rate as a margin %. An Initial margin is in the margin currency, and Forex and CFD Leverage symbols divide it by the leverage: convert it before using Per lot.
The margin and the value of a move both change with the price, so the calculator solves the last line for each direction. A long and a short reach the stop-out at different distances.
Worked examples
All use a made-up USD account with $5,000 of equity and a 50% stop-out. Prices are illustrative.
When the pair’s base currency is your account currency, no rate is involved: 0.50 lot of USDJPY at 1:30 needs 0.50 × 100,000 ÷ 30 = $1,666.67 on a USD account at any price.
Leverage caps for retail clients
ESMA capped CFD leverage for retail clients of EU brokers in 2018, and set a margin close-out at 50% of the required margin, per account:
| Asset class | Leverage cap | Margin |
|---|---|---|
| Major currency pairs | 30:1 | 3.33% |
| Non-major currency pairs, gold, major indices | 20:1 | 5% |
| Commodities other than gold, non-major equity indices | 10:1 | 10% |
| Individual equities and other reference values | 5:1 | 20% |
| Cryptocurrencies | 2:1 | 50% |
A major pair is any two of the US dollar, euro, yen, pound, Canadian dollar and Swiss franc, so pairs with the Australian or New Zealand dollar are non-major. The calculator starts at the cap for the instrument’s class and shows it next to the result. Brokers regulated elsewhere may offer more.
Margin level, margin call and stop-out
Your margin level falls as open trades lose. A broker’s margin call level is a warning. At the stop-out level the broker starts closing positions, and it does not wait for your stops. Both levels are in your account terms.
The distance to the stop-out is for one position on its own. It follows the margin as the price moves, but holds any second exchange rate (GBPUSD for EURGBP on a USD account) at today’s value. It leaves out spread, swap and commission, and every other open trade draws on the same equity.
Common mistakes
- Reading leverage as risk. The loss per pip depends on the lot size, not on the leverage; more leverage only lets a larger position fit. The pip value calculator shows what a pip is worth at your size, and the position size calculator sizes a trade from its stop.
- Using free margin as a size target. Opening everything the margin allows leaves almost no room before a stop-out.
- Forgetting other positions. The margin level is for the whole account. Two trades share one cushion.
- Missing margin changes. Brokers can raise margins around weekends, holidays and major news, and some tier the leverage by position size. Check your broker’s terms.
How PipWarden handles this
PipWarden does not size trades from the margin available. It sizes every order from your risk limit, using the tick value and volume step that MT5 reports for the symbol, rounds down, and skips a trade that would need less than the minimum lot rather than raising the risk. Before every order it also checks that the free margin left after the new order’s margin stays above your minimum, 20% of equity by default, using the margin MT5 reports for the symbol where it can.
Those checks happen when an order is placed. Open trades run to their own stops, and gaps or slippage can make a loss larger than planned. PipWarden runs in MT5 on a Windows PC or VPS, with a broker that allows Expert Advisors; it does not run on a phone. See how it works, the features and which brokers work, and read the risk disclosure.
Frequently asked questions
How is forex margin calculated?
How is margin calculated for gold (XAUUSD)?
How is margin calculated for NAS100, US30 and other indices?
What is margin level?
What is free margin?
What is the difference between a margin call and a stop-out?
What leverage should I use?
Educational content, not financial advice. Forex and CFDs are traded on margin and are high risk: you can lose money, and more than your deposit with some brokers. Examples use made-up numbers and show no real results. Read the risk disclosure.