

Leverage calculator: how to calculate margin and stop-out level
Prepared by the Libertex team
Content reviewed internally in accordance with regulatory standards.
Required margin, free margin, margin level, margin call and stop-out form one calculation chain. Spread and slippage sit outside it. Libertex is a Stock and CFD Broker.
Key takeaways
- Required margin: a leverage calculator divides position value by the leverage ratio to produce the required margin.
- Account room: free margin and margin level show how much room an account has before the 50% close-out.
- Excluded costs: spread, commission, overnight financing and slippage apply to the position, not to the calculated margin.
What is leverage and how does it differ from margin?
Leverage is the ratio between position value and the margin holding it. At 20:1, one unit of margin controls 20 units of exposure in contracts for difference.
A mortgage down payment works like leverage: a small amount controls a larger asset. Leverage multiplies losses in the same proportion as gains.
The European Securities and Markets Authority (ESMA) set retail limits by asset class on 27.03.2018. Limits run from 30:1 on major currency pairs to 2:1 on cryptocurrencies.
Leverage vs margin: what is the difference?
- Leverage is the multiplier, written as a ratio such as 20:1, that sets total exposure.
- Margin is the part of the account reserved to hold the position, and it is not borrowed money.
The two values move in opposite directions on one position: a higher ratio reserves less margin. Traders who treat leverage and margin as one number misjudge the exposure a deposit carries.
How does a leverage calculator work?
A leverage calculator converts trade inputs into the position value and the required margin. Automating the arithmetic reduces the chance of manual errors. Calculator output describes what a position costs to hold at that moment, as a planning figure rather than a prediction.
Key inputs for an accurate calculation
- Instrument: sets the current price and the ESMA leverage limit for the asset class.
- Position size: the number of units, or the lot size traded.
- Account currency: the margin appears in this currency, so the exchange rate matters.
- Entry price: the instrument's current price.
- Leverage ratio: the multiplier applied to the position value.
One estimated input changes every output, so accuracy depends on the figures entered.

Core formulas behind the calculator
Position value = price × quantity
Required margin = position value ÷ leverage
Net result = price change × quantity - costs
Equivalent form: position size = margin × leverage
Contract size, currency conversion and the broker's own margin rates change the exact figure. Position size = margin × leverage restates the same relationship from the margin side. The four formulas above work as a starting framework rather than a final number.
How to calculate required margin
A leverage calculator produces the required margin in six steps.
- The trader selects the instrument and its leverage limit.
- Position size goes in next, in units or lots.
- Account currency sets the currency of the result.
- Leverage ratio completes the inputs.
- The calculator displays the required margin.
- A comparison with free margin closes the check.
Worked example: margin at different leverage levels
Example calculation: a CFD position of 100,000 units on EUR/USD at 1.1000 produces a position value of $110,000. At 30:1, the required margin equals $3,666.67 (110,000 ÷ 30).
Table applies each ESMA limit to a $100,000 position.
| Leverage | Underlying asset class of the CFD | Margin, % of position | Required margin |
| 30:1 | Major currency pairs | 3.33% | $3,333.33 |
| 20:1 | Non-major pairs, gold, major indices | 5% | $5,000 |
| 10:1 | Other commodities, non-major equity indices | 10% | $10,000 |
| 5:1 | Individual equities | 20% | $20,000 |
| 2:1 | Cryptocurrencies | 50% | $50,000 |
Source: ESMA (27.03.2018).
Exposure stays at $100,000 in every row. Required margin falls from $50,000 at 2:1 to $3,333.33 at 30:1. The gain or loss on a fixed position does not change with the leverage ratio. Only the margin reserved changes.
Key margin metrics: used margin, free margin and margin level
Three numbers show the room an account has: used margin, free margin and margin level. All three are measured against equity: balance plus open gain or loss. MetaTrader 4 and MetaTrader 5 display them in the account window. Brokers may define equity differently, and trading conditions vary by jurisdiction, account type and legal entity.
What is the used margin?
Used margin is the total margin reserved for all open positions on an account. Positions add up: three open positions reserving $5,000 each lock $15,000 of used margin.
What is free margin?
Free margin is the amount left to open further positions or to absorb losses.
Free margin = equity - used margin
An account with $10,000 of equity and $5,000 of used margin holds $5,000 free.
What is the margin level?
Margin level is one of the account-level numbers that show account stress, expressed as a percentage.
Margin level = equity ÷ used margin × 100%
A falling margin level moves an account towards the margin call and stop-out thresholds. Brokers set those thresholds in their own terms, so the trader checks the account agreement.
What is actual leverage?
Actual leverage is total open position value divided by account equity. A $100,000 position on a $10,000 account runs at 10:1.
Example calculation: equity $10,000, position $100,000 at 20:1. Used margin $5,000, free margin $5,000, margin level 200%, actual leverage 10:1. A 3% move costs $3,000: equity $7,000, free margin $2,000, level 140%.
Margin call and stop-out
Stop-out, also called close-out or liquidation, closes positions automatically once the margin level falls far enough. A margin call arrives earlier, as a warning. The two subsections below separate the warning stage from the distance to close-out.
What is a margin call and how does it differ from stop-out?
A margin call warns the trader that the margin level has hit the broker's threshold. A stop-out, or close-out, then closes positions automatically.
ESMA rules of 27.03.2018 close EU retail accounts out at 50% of required margin, with negative balance protection. National measures kept both requirements in force as of 24.02.2026.
Example calculation continued: a 7.5% move on the $100,000 position costs $7,500. Equity falls to $2,500 and the margin level to 50%.

Rule of thumb: the adverse move to stop-out
The move that erases the margin runs at about 1 divided by leverage. Half that distance reaches the 50% close-out.
| Leverage | Adverse move that erases the margin | Adverse move at the 50% close-out |
| 30:1 | 3.33% | 1.67% |
| 20:1 | 5% | 2.5% |
| 10:1 | 10% | 5% |
| 5:1 | 20% | 10% |
| 2:1 | 50% | 25% |
Source: close-out rule from ESMA (27.03.2018).
Table 2 assumes an account holding margin for one position and ignores costs, so the real threshold arrives earlier. The rule of thumb is a first-pass check, not a calculator replacement.
What a leverage calculator does not include
A leverage calculator estimates one moment and leaves out costs, slippage and broker rules.
- Costs: spread, commission and overnight financing apply to the full position value, not the margin. A 0.1% example fee costs $100 on a $100,000 position, or 2% of a $5,000 margin. The 0.1% is an example, not a Libertex rate.
- Slippage and price gaps: in fast markets an order can fill at an unexpected price.
- Broker rules: margin rates, margin call levels and equity calculation differ by broker and account type. How to compare CFD brokers covers those conditions.
- Currency conversion: margin in another currency moves with the exchange rate. The European Central Bank published a euro reference rate of $1.1195 per euro.
Conclusion
Leverage sets the margin a CFD position reserves: position value divided by leverage. Free margin and margin level show the account state between opening and close-out. EU rules place the retail close-out at 50% of required margin, set by ESMA on 27.03.2018 and confirmed on 24.02.2026.
The calculated margin stays an estimate: costs apply to the full position. Trading CFDs with leverage carries risk and can lead to losing all invested capital.
Frequently asked questions
What is a leverage calculator and what does it calculate?
A leverage calculator converts instrument, position size, entry price and leverage into the position value and required margin. The result shows the amount reserved before the trade opens. A $100,000 position at 20:1 requires $5,000 of margin. Exact margin parameters vary by broker and account type.
What is the difference between leverage and margin?
Leverage is the ratio between position value and margin, such as 20:1. Margin is the amount reserved from the account to hold the position, and the two move in opposite directions. A $100,000 position reserves $3,333.33 at 30:1 and $10,000 at 10:1. Margin rates vary by broker and account type.
What is the maximum leverage for retail CFD traders in the EU?
ESMA limits set on 27.03.2018 cap retail CFD leverage by asset class. The range runs from 30:1 for major currency pairs to 2:1 for cryptocurrencies. Gold and major indices sit at 20:1, and individual equities at 5:1. Applicable limits vary by broker and account type.
What is a margin call, and how does it differ from stop-out?
A margin call is a warning sent when the margin level reaches a threshold set by the broker. A stop-out closes open positions automatically. ESMA rules in force across the EU set the retail close-out at 50% of required margin. Margin call levels vary by broker and account type.
Does leverage change pip value or the gain and loss on a position?
No. Pip value depends on position size, the currency pair and the exchange rate. The gain or loss on a fixed position stays the same at 5:1 and at 30:1. Only the reserved margin changes. Calculation details vary by broker and account type.
How is actual leverage calculated?
Actual leverage equals the total value of open positions divided by account equity. A $100,000 position on a $10,000 account gives 10:1, or ten times equity. Actual leverage can sit below the maximum ratio available. Equity definitions vary by broker and account type.
This article is provided for informational and educational purposes only. The article does not constitute investment, financial, tax or legal advice. Nothing in the article is a recommendation to trade or hold any instrument. Every investment carries risk, including the possible partial or total loss of the invested capital. Contracts for difference are complex instruments and are not suitable for every investor because of the effect of leverage. Before investing, a trader should assess their own objectives, experience and tolerance for risk.
Disclaimer: This article is provided for educational and informational purposes only. It does not constitute financial or investment advice, independent investment research or a recommendation by Libertex. Any examples, scenarios or forecasts are for illustrative purposes only and should not be relied upon as indicators of future performance. Past performance is not a reliable indicator of future results.
Why trade with Libertex?
- Get access to a free demo account free of charge.
- Enjoy technical support from an operator 5 days a week, from 9 a.m. to 9 p.m. (Central European Standard Time).
- Use a multiplier of up to 1:30 (for retail clients).
- Operate on a platform for any device: Libertex and MetaTrader.