# Fair Stop Out

The Fair Stop Out algorithm closes positions in descending order of margin used. This way each time the stop out margin level is reached, then the position using the most of the margin is closed, irrespective of profitability, meaning profitable positions could be closed.

##### Fair Stop Out Example

If an account has the following properties:
Balance: \$500
Leverage: 1:500
Smart Stop Out: 50%
Equity: \$500

If the account opens two positions of:
BUY - 150,000 - USD/JPY - Margin = \$300
BUY - 100,000 - USD/JPY - Margin = \$200

Both positions have the same entry price.

The account will immediately be left with a 100% margin level. Once 100% margin level is reached no more positions which require additional margin can be opened.

Once the price of USD/JPY falls by 10 Pips the Margin Level will become 50% and will trigger Fair Stop Out.

Calculation
Pip value of 250,000 USD/JPY = ¥2,500 (÷101.33 = \$24.67)
10.2 [Pips] x \$24.67 [Pip Value] = \$251.63
Equity (\$500 - \$251.63 [Unrealized P&L] = \$248.37) ÷ \$500 [Margin Used] = 0.497 (x 100 = 49.7%)

Once Fair Stop Out has been reached cTrader will need to do react to restore the accounts Margin Level to be greater than Fair Stop Out level. cTrader will close the position using the most margin.

In this case, the position of 150,000 USD/JPY will be closed, because it uses the most margin of the two positions.

Closing 150,000 USD/JPY at a loss of 10.2 Pips will cause a loss of \$150.96, and will reduce the amount of margin required to retain the position by \$300.

Below you will see how this event effects the account and the calculations used.

Balance = \$349.04

Calculation \$14.80 [Pip Value of 150,000 USD/JPY] x 10.2 [Loss in Pips] = \$150.96 \$500 [Balance] - \$150.96 [Realized Loss] = \$349.04

Margin Used for 100.000 USD/JPY = \$200

Unrealized P&L = -\$100.66

Calculation ¥1,000 [Pip Value of 100,000 USD/JPY] x 10.2 [Loss in Pips] = ¥10,200 (÷101.33 [USD/JPY Rate]) = \$100.66

Equity = \$248.35

Calculation \$349.01 [Balance] - \$100.66 [Unrealized P&L] = 248.35

Margin Level = 124%

Calculation 248.35 [Equity] ÷ 200 [Margin Used] =1.24 x 100 = 124%

Now the account’s Margin Level has been increased to 124% which is well above Fair Stop Out Level.