# Forex Margin Formula

This calculation computes the approximate rate at which a margin closeout will occur for a single position. The formula assumes you have only one open position and that the rates are fixed to the current market snapshot. This calculation follows the following formulas:

If the account currency is the same as the base of the currency pair

Buy Position MR = (2mOU) / (2mb + 2mU - U)
Sell Position MR = (-2mOU) / (2mb - 2mU -U)

Account currency is the same as the quote of the currency pair

Buy Position MR = (2m(OU - b)) / U(2m-1)
Sell Position MR = (2m(OU + b)) / U(2m+1)

If neither the quote nor base of the currency pair is the same as the account currency

Buy Position MR = (2m(b - UOH)) / (1 - 2m)UH
Sell Position MR = (2m(b + UOH)) / (1 + 2m)UH

Where :

MR = Margin Closeout rate (approx.)
m = Margin Ratio
U = Units Held
O = Opening Rate of position
b = Account Balance
H = Quote Home rate (X/USD)

Example for typical AUD/USD margin closeout with a 'BUY' position:
m = 30 (30:1 Margin ratio)
U = 200,000
O = 0.55938
b = 5700.02

We will use the following formula : MR = (2m(OU - b)) / U(2m-1)

MR = (2 * (30) * ((0.55938 * 200000) - 5700.02)) / (200000 * (2 * (30) - 1))
MR = (60 * (111876 - 5700.02)) / (200000 * 59)
MR = (60 * 106175.98) / (11800000)
MR = 6370558.8 / 11800000
MR = 0.53987

Go Back to the Margin Closeout Calculator