The profit and loss of open positions is shown as the total unrealized P/L and realized P/L and is calculated using the position's sell price and average cost.
Unrealized P/L: Refers to the profit or loss on an open position if it were closed at the current market price.
Realized P/L: Refers to the actual profit or loss that is made when shares are sold or a position is closed.
Transactions Fees: All fees related to buying or selling stock, or maintenance and storage fees.
Definition | Formula |
Unrealized Profit & Loss (P/L) | Unrealized P/L = (Current Price – Average Cost) * Total Quantity of Shares |
Realized Profit & Loss (P/L) | Realized P/L = (Previous Realized P/L) + ((Sell Price – Average Cost) * Sell Qty) – Transaction Fees Note: If there is no previous realized P/L, the amount is 0 |
Profit & Loss (P/L) | P/L = Unrealized P/L + Realized P/L |
Example 1: Opening a position
Before the transaction day (Day T), you held no position in Alibaba (BABA). On Day T, you bought 200 shares of BABA at $200 per share with $10 in transaction fees, and the current closing price was $205.
Then the average cost of the opened position is as follows:
Average Cost = ((Previous Average Cost * Previous Qty) + (Purchase Price * Purchase Qty) + Transaction Fees) / Total Qty
= (($200 * 200) + $10) / 200
= $200.05
Average Cost | Current Price | Quantity | Position P/L | Unrealized P/L | Realized P/L |
200.05 | 205 | 200 | 990 | 990 | 0 |
Example 1 (Continued): Selling some shares
On the day after the transaction day (Day T+1), you sold 100 shares at $210 per share with $10 in transaction fees, and the new current closing price was $215.
The average cost remains the same as no new shares were purchased. However, the profit and loss of open positions is updated:
Average Cost = $200.05
Realized P/L = (($210 – $200.05) * 100) – $10 = $985
Average Cost | Current Price | Quantity | Position P/L | Unrealized P/L | Realized P/L |
200.05 | 215 | 100 | 2480 | 1495 | 985 |
Example 1 (Continued): Buying more shares
Five days after the transaction day (Day T+5), you bought another 100 shares at $205 per share with $10 in transaction fees, and the new current closing price was $215.
The average cost is updated based on the purchase of more shares at the new purchase price:
Average Cost = ((Previous Average Cost * Previous Qty) + (Purchase Price * Purchase Qty) + Transaction Fees) / Total Qty
Average Cost = (($200.05 * 100) + ($205 * 100) + $10) / 200 = $202.575
Average Cost | Current Price | Quantity | Position P/L | Unrealized P/L | Realized P/L |
202.575 | 215 | 200 | 3470 | 2485 | 985 |