ComputeYard

The math, explained — built by a derivatives quant.

Margin Calculator

See how much equity you must post to buy or short on margin, how much you borrow, your leverage, and the price at which a maintenance margin call hits.

How it works

When you trade on margin, the broker requires you to post a fraction of the position value as your own equity — the initial margin. The rest is a loan from the broker. The position value is simply entry price × shares; the initial margin is that value times your initial-margin percentage, and the amount borrowed is whatever is left over.

Your leverage is position value ÷ equity (the same as 1 ÷ initial margin %): post 50% and you control twice your cash. As the price moves against you your equity shrinks, and once equity ÷ position value falls to the maintenance margin percentage the broker issues a margin call. This tool solves for that exact trigger price for both long and short positions.

Worked example

Buy 100 shares at $100 long, with a 50% initial margin and a 25% maintenance margin:

  • Position value = $100 × 100 = $10,000.
  • Initial margin (equity you post) = $10,000 × 50% = $5,000; amount borrowed = $5,000.
  • Leverage = $10,000 ÷ $5,000 = 2.00×; maintenance margin = $10,000 × 25% = $2,500.
  • Margin-call price = $100 × (1 − 0.50) ÷ (1 − 0.25) = $50 ÷ 0.75 = $66.67.

So if the stock falls to about $66.67, your equity drops to the 25% maintenance level and the broker calls for more cash or liquidates the position.

The formula

position_value  = entry_price × shares
initial_margin  = position_value × initial_margin_%
amount_borrowed = position_value − initial_margin
leverage        = position_value ÷ initial_margin
maintenance     = position_value × maintenance_margin_%

margin call price:
  long :  entry × (1 − initial_%) ÷ (1 − maintenance_%)
  short:  entry × (1 + initial_%) ÷ (1 + maintenance_%)

FAQ

What is a margin call price?
It's the price at which your equity falls to the broker's maintenance-margin requirement. Cross it and you must add cash or have positions liquidated.
How is leverage calculated?
Leverage is position value divided by the equity you post, which equals 1 ÷ initial-margin percentage — a 50% initial margin gives 2× leverage.
Does this work for short positions?
Yes. Set direction to short and the call price uses the short formula, since a short loses money as the price rises.

More calculators