Cost Required to Open a Position
Traders should ensure that they have a minimum fund in their wallet balance before opening a position. The cost required to open a position includes the initial margin and open loss (if any). Open loss occurs when the order price is unfavorable to the traders i.e. mark price is lower than the order price for a long order.
Finandy includes open loss as one of the costs required to open a position to avoid forced liquidation when the traders place the order. If the open loss is not included as one of the cost required to open a position, there is a high probability that users’ position will get liquidated immediately once they have placed such order.
Cost = Initial Margin + Open Loss (if any)

Cost Required to Open a LIMIT or STOP order

Step 1: Calculate the initial margin

Initial Margin = Notional Value / Leverage = (9,253.30 x 1 BTC) / 20 = 462.66

Step 2: Calculate Open Loss

Open Loss = Number of Contract x Absolute Value {min[0, direction of order x (mark price - order price)]} *direction of order: 1 for long order；-1 for short order
(i) Open loss of long order
Number of Contract x Absolute Value {min[0, direction of order x (mark price - order price)]} = 1 x Absolute Value {min[0, 1 x (9,259.84 - 9,253.30)]} = 1 x Absolute Value {min[0, 6.54]} = 1 x 0 = 0 There is no open loss when the user opens a long order.
(ii) Open loss of short order
= Number of Contract x Absolute Value {min[0, direction of order x (mark price - order price)]} = 1 x Absolute Value {min[0, -1 x (9,259.84 - 9,253.30)]} = 1 x Absolute Value {min[0, -6.54]} = 1 x 6.54 = 6.54 There is an open loss when the user opens a short order.

Step 3: Calculate the cost required to open a position

Since the long order has no open loss, thus the cost required to open a long position is equivalent to the initial margin.
(i) Cost Required to Open a Long Position
= 462.66 + 0 = 462.66 Short order has an open loss, thus the cost required to open a short position is higher as we need to take open loss into consideration besides the initial margin.
(ii) Cost Required to Open a Short Position
= 462.66 + 6.54 = 469.20 (rounding difference)

Cost Required to Open a MARKET order

Step 1: Calculate assuming price

Long order: assuming price = ask * (1 + 0.05%) , Open order: assuming price = max(bid, mark price)
(i) Assuming price of long order
= ask (1 + 0.05%) =10461.77 (1 + 0.05%) = 10467.0009
(ii) Assuming price of short order
= max(bid, mark price) = max (10461.78, 10461.78) = 10461.78 *：Level 1 price

Step 2: Calculate the initial margin

Initial Margin = Notional Value / Leverage
(i) Initial margin of long order
= Assuming price of long order Number of Contract / Leverage = 10467.0009 0.2 / 20 = 104.670009
(ii) Initial margin of short order
= Assuming price of short order Number of Contract / Leverage = 10461.78 0.2 / 20 = 104.6178

Step 3: Calculate Open Loss

Open Loss
= Number of Contract x Absolute Value {min[0, direction of order x (mark price - order price)]}
*direction of order: 1 for long order；-1 for short order
(i) Open loss of long order
= Number of Contract x Absolute Value {min[0, direction of order x (mark price - order price)]} = 0.2 x Absolute Value {min[0, 1 x (10461.78 - 10467.0009)]} = 0.2 x Absolute Value {min[0, -5.2309]} = 0.2 x 5.2309 = 1.04418
There is an open loss when the user opens a long order.
(ii) Open loss of short order
= Number of Contract x Absolute Value {min[0, direction of order x (mark price - order price)]} = 0.2 x Absolute Value {min[0, -1 x (10461.78 - 10461.78)]} = 0.2 x Absolute Value {min[0, 0]} = 0.2 x 0 = 0
There is no open loss when the user opens a short order.

Step 4: Calculate the cost required to open a position

Long order has an open loss, thus the cost required to open a long position is higher as we need to take open loss into consideration besides the initial margin.
(i) Cost Required to Open a Long Position
= 104.670109 + 1.04418 = 105.71 (rounding difference)
Since the short order has no open loss, thus the cost required to open a short position is equivalent to the initial margin.
(ii) Cost Required to Open a Short Position
= 104.6178 + 0 = 104.61 (rounding difference)