Calculation of profit and loss
  1. 1.Floating profit and loss are calculated online on the basis of price of the last transaction with the instrument. With opening of position at average entry price P1, by lot lot and price of the last transaction P last
    Where tick_size – minimal instrument price step; tick_value – price of the minimal instrument step.
  2. 2. Calculation of profit and loss of the buyer and the seller at opening of position at average entry price P1, by volume volume and average position closing price P2

Let’s have a look at diagrams of buyer’s and seller’s profit change in BTC of a swap contract sBTCUSD . With P1=10 000, lot=100, step = 0.1 step_price = 0.00000010 and price change range P2 = (2000..20000).

And diagrams Profit = f(P2) и of buyer’s and seller’s profit change in USD of a swap contract sBTCUSD with P1=10 000, lot=100, step = 0.1 step_price = 0.00000010 and price change range P2 = (2000..20000).

Example of risk management indicator calculation is presented below. For three super-traders trading with each other. Exchange fee is not taken into account to simplify the calculation.

Market situation
Risk management indicators
Bob
Alex
Jack
Everybody has deposited 1 BTC
WalletBalance
Available Balance
Margin Balance
Order Margin
Position Margin
Liquidation Position Margin
1
1
1
0
0
0
1
1
1
0
0
0
1
1
1
0
0
0
Current price 4000. Dima set sales order for lot 10, price 5000. Jack set sales order - price 10000, lot 10.
WalletBalance
Available Balance
Margin Balance
Order Margin
Position Margin
Liquidation Position Margin
1
0,995
1
0,005
0
0
1
1
1
0
0
0
1
0,99
1
0,01
0
0
Current price 5000. Alex purchased 10 contracts at price of 5000$ from Bob
WalletBalance
Available Balance
Margin Balance
Order Margin
Position Margin
Liquidation Position Margin
1
0,995
1
0
0,005
0,0025
1
0,995
1
0
0,005
0,0025
1
0,99
1
0,01
0
0
Current price 10000. Bob purchased 10 contracts at price of 10000 from Jack.
WalletBalance
Available Balance
Margin Balance
Order Margin
Position Margin
Liquidation Position Margin
0,95
0,95
0,95
0
0
0
1
1,04
1,05
0
0,01
0,005
1
0,99
1
0
0,01
0,005
Current price 15000. Bob set sales order at price of 20000, lot 100
WalletBalance
Available Balance
Margin Balance
Order Margin
Position Margin
Liquidation Position Margin
0,95
0,75
0,95
0,2
0
0
1
1,085
1,1
0
0,015
0,0075
1
0,935
0,95
0
0,015
0,0075
Current price 20000. Jack purchased 20 contracts and Alex purchased 80 contracts from Bob
WalletBalance
Available Balance
Margin Balance
Order Margin
Position Margin
Liquidation Position Margin
0,95
0,75
0,95
0
0,2
0,1
1
0,97
1,15
0
0,18
0,09
0,9
0,88
0,9
0
0,02
0,01
Current price 10000
WalletBalance
Available Balance
Margin Balance
Order Margin
Position Margin
Liquidation Position Margin
0,95
1,85
1,95
0
0,1
0,05
1
0,16
0,25
0
0,09
0,045
0,9
0,79
0,8
0
0,01
0,005
Current price 5000. Alex is closed by liquidation at price of 7602, Bob executes liquidation rate of 90 contracts at price of 7602 for Alex.
WalletBalance
Available Balance
Margin Balance
Order Margin
Position Margin
Liquidation Position Margin
1,16582
2.21082
2,21582
0
0,005
0,0025
0
0
0
0
0
0
0,9
0,745
0,75
0
0,005
0 0,0025