Regardless of any trades, it is important to understand how P&L is calculated before entering one. In sequential order, traders need to understand the following variables in order to accurately calculate their P&L.
1) Average Entry Price of position
2) Unrealized P&L and unrealized P&L% of position
3) Closed P&L
4) Realized P&L
5) Definition of P&L terms
1) Average Entry Price (AEP) of position
In Bybit, due to our inverse contract trading (BTCUSD, ETHUSD, EOSUSD, and XRPUSD), whenever traders add on to their position via new orders, AEP will change.
For example: Trader A holds an existing BTCUSD open buy position of 1,000 qty with an entry price of USD 5,000. After an hour, Trader A decided to increase his buy position by opening an additional 2,000 qty with an entry price of USD 6,000. Below shows the formula for AEP and the computation steps.
Average entry price = Total quantity of contracts / Total contract value in BTC
By using the figures above:
a) Total quantity of contracts
= 1,000 + 2,000
= 3,000
Total contract value in BTC
= (1,000 / 5,000) + (2,000 / 6,000)
= 0.53333334 BTC
Average entry price
= (3,000 / 0.53333334 BTC)
= 5,625.00 USD
2) Unrealized P&L
Once an order is successfully executed, an open position and its real-time unrealized P&L will be shown in the positions tab.
Depending on which side of the trade you are in, the formula used to calculate the unrealized P&L will differ.
For long position:
Trader B holds an existing BTCUSD open buy position of 1,000 qty with an entry price of USD 5000. When the Last Traded Price in the order book is showing USD 5,500, the unrealized P&L shown will be 0.01819 BTC.
Unrealized P&L = Contract Qty x [(1/Avg Entry Price) - (1/Last Traded Price)]
= 1,000 x [ (1 / 5,000) - (1 / 5,500) ]
= 1,000 x 0.00001819 BTC
= 0.01819 BTC
For short position
Trader C holds an existing BTCUSD open sell position of 1,000 qty with an entry price of USD 5,000. When the Last Traded Price inside the order book is showing USD 4,500, the unrealized P&L shown will be 0.02223 BTC.
Unrealized P&L = Contract Qty x [(1/Last Traded Price) - (1/Avg Entry Price)]
= 1,000 x [ (1 / 4,500) - (1 / 5,000) ]
= 1,000 x 0.00002223 BTC
= 0.02223 BTC
Note:
a) Due to the characteristics of inverse contracts, your P&L is settled in coin type instead of USD. The USD serves mainly as a price quote mechanism for the convenience of traders.
b) This means that when the price movement is by a certain price (for example, USD 500) in the profitable or non-profitable direction, it does not mean that you will gain or lose USD 500 respectively.
c) Increasing leverage does not multiply your profits/losses directly. Instead, profits and losses are determined by the position size and price movement. In short,
- The higher the leverage, the lower the margin collateral needed to open your position
- The larger the contract quantity, the bigger the profits/losses.
- The larger the price movement relative to the entry price, the bigger the profits/losses.
d) The default unrealized P&L is shown based on the Last Traded Price. When hovering a mouse cursor on top of the figure, the unrealized P&L will change and show an unrealized P&L based on the Mark Price
e) Last but not least, unrealized P&L does not factor in any trading or funding fees which traders may have received/paid out in the process of opening and holding the position.
2A) Unrealized P&L%
Unrealized P&L% basically shows the Return on Investment (ROI) of the position in its percentage form. Just like the Unrealized P&L, this figure also varies depending on the movement of the Last Traded Price. As such, the Unrealized P&L% or ROI formula is below.
Unrealized P&L% = [ Position's unrealized P&L / Position Margin ] x 100%
Position Margin = Initial margin + Fee to close
Again using Trader B as an example, Trader B holds an existing BTCUSD open buy position of 1,000 qty with an entry price of USD 5,000. When the Last Traded Price inside the order book is showing USD 5,500, the unrealized P&L shown will be 0.01819 BTC. Assuming the leverage used is 20x.
Based on our earlier calculation, the position's unrealized P&L = 0.01819 BTC
Initial margin = Qty / (entry price x leverage) = 1,000 / (5,000 x 20) = 0.01 BTC
Fee to close = (Qty / Bankruptcy Price) x 0.055% = (1,000/4,762) x 0.055% = 0.0001154 BTC
Unrealized P&L% = [ 0.01819 BTC / ( 0.01 BTC + 0.0001154 BTC ) ] x 100% = 179.824%
Note:
a) Some traders may have misunderstood this but adjustments to increase leverage do not increase your unrealized profits. Instead, traders will see an increase in unrealized P&L% due to a reduction in your position margin and not because of an increase in actual profits. Using Trader B as an example again, notice that regardless if leverage is 20x, 10x or 50x, the unrealized P&L remains the same.
- If Trader B uses the same 20x leverage, his unrealized P&L = 0.01819 BTC, unrealized P&L% = 179.824%
- If Trader B reduces the leverage to 10x, his unrealized P&L = 0.01819 BTC, unrealized P&L% = 90.428%
- If Trader B increases the leverage to 50x his unrealized P&L = 0.01819 BTC, unrealized P&L% = 441.998%
b) For cross margin mode, the position margin will always be calculated using the maximum leverage allowed under the current risk limit level for the particular coin (Example BTCUSD = 100x).
3) Closed P&L
When traders finally close their position, the P&L becomes realized and is recorded inside the Closed P&L tab within the Assets page. Unlike unrealized P&L, there are some major differences in the calculation. Below summarizes the differences between the unrealized P&L and closed P&L.
|
|
|
|
|
|
|
|
|
|
|
|
Therefore, assuming full closing of the entire position, the formula for calculating Closed P&L is as follows.
Closed P&L = Position P&L - Fee to open - Fee to close - Sum of all funding fees paid/received
Using Trader C as an example, Trader C holds an existing BTCUSD open sell position of 1,000 qty with an entry price of USD 5,000. When the Last Traded Price inside the order book is showing USD 4,500, trader C decided to close the entire position via the Close by Market function. Assuming that Trader C also opened the position via a market order and funding fees totaling 0.00005 BTC was paid out while holding the position.
Based on our earlier calculation, the position's P&L = 0.02223 BTC received
Fee to open = (1,000 / 5,000) x 0.055% = 0.00011 BTC paid out
Fee to close = (1,000/4,500) x 0.055% = 0.0001222 BTC paid out
Sum of all funding fees paid/received = 0.00005 BTC paid out
Closed P&L = 0.02223 - 0.00011 - 0.0001222 - 0.00005 = 0.0219478 BTC
Note:
a) The above example only applies when the entire position is opened and closed via a single order in both directions.
b) For partial closing of positions, Closed P&L will pro-rate all fees (fee to open and funding fee(s)) according to the percentage of the position partially closed and use the pro-rated figure to compute the Closed P&L.
c) Traders can view their Closed P&L history from here.
Realized P&L = Sum of realized position P&L - Trading fees - Funding fees over the period of position opening
Realized P&L can be found on the position tab and it shows the sum of realized P&L of the position over the period. This includes all the trading fees, funding fees, and any position P&L realized from partial closing (same formula with unrealized P&L).
We can use Trader C as an example. Assuming Trader C did not fully close the 1,000 qty short position, but only 500 qty with an exit price of 4,500.
Position's P&L = 500 x [ (1 / 4,500) - (1 / 5,000) ] = 0.01111111 BTC
Fee to open = (1,000 / 5,000) x 0.055% = 0.00011 BTC
Fee to close = (500/4,500) x 0.055% = 0.00006111 BTC
Sum of funding fees paid = 0.00005 BTC
Realized P&L of the position = 0.01111111 - 0.00011 - 0.00006111 - 0.00005 = 0.01089 BTC
Trader C is left with 500 of a short position. He then opened another 300 qty of short position with an entry price of USD 5,200, the realized P&L for the position is as follows:
Realized P&L carried forward = 0.01089 BTC
Fee to open = (300 / 5,200) x 0.055% = 0.00003173 BTC
Realized P&L (up-to-date) = 0.01085287 BTC
Outstanding open position = 800 Qty short position
The difference between the realized P&L and closed P&L is that for Closed P&L, in the event of partial closing of positions, it will prorate all fees (fee to open and funding fee(s)) according to the percentage of the position partially closed and use the pro-rated figure to compute the Closed P&L while the realized P&L will update in real time and accumulate until the respective direction of position is fully closed.
If Trader C placed a 1,000 qty long order, the 800 qty short position will be closed and a new 200 qty long position will be opened. The realized P&L will recalculate and show the realized P&L of the 200 qty long position.
Note: The feature will be supported on July 13, 2022. Hence, any realized P&L of the position that was opened before and yet to be closed after July 13, 2022 will not be captured and included.
5) Definition of P&L terms
In the Closed P&L tab, traders will be able to see various P&L terms right under the Closed P&L table. Each P&L term has its uses and definition.
a) Total Realized P&L
Total realized P&L = Sum (since first trade) of all position P&L + trading fees + funding fees
Note:
Total realized P&L is permanent and cannot be changed or reset to zero.
b) Daily Realized P&L
Daily realized P&L = Sum (with 24 hours) of all position P&L + trading fees + funding fees
Note:
— Daily realized P&L accounts for a time period between 12AM (midnight) UTC and 12AM (midnight) UTC the following day.
— Unlike position Realized P&L, Daily Realized P&L will be reset to zero at 12AM (midnight) UTC every day and recalculate the realized P&L of the day.
c) Unrealized P&L (Mark Price)
Unrealized P&L (Mark Price) = Unrealized P&L of existing open position based on current Mark Price
d) Unrealized P&L (Last Traded Price)
Unrealized P&L (Last Traded Price) = Unrealized P&L of existing open position based on current Last Traded Price