The following formulas are used to calculate Profit / Loss:
Profit / Loss ($):
P/L $ = (Current Price USD - Open Price USD) * amount
Profit / Loss (%):
P/L % = (Current Price USD / Open Price USD - 1) * 100%
For more information about Open Price please read this article and for Current Price this article.
Example
1. John Smith has 100 ETH in his Wallet. He transfers 70 ETH to his Portfolio. The Open Price ($) and Current Price ($) are equal at the moment of transfer ($1100), therefore P/L ($ and %) are both set to 0.
2. John buys 1562.5 ETС for 50 ETH. The current ETC/ETH price is 0.032 and the current price of ETH/USD is $1120 - making the Open Price ($) for ETC $35.84. The P/L ($ and %) values for ETC will initially be set to 0 - until the market changes, however, both of the P/L values for ETH will change to align with the Portfolio's new asset allocation (from 50 to 20 ETH), along with ETH's price change (from $1100 to $1120).
P/L ($) for ETH will be recalculated to $400:
($1120 - $1100) * 20 = $400
and ETH's P/L (%) will become +1.8%:
($1120 / $1100 - 1) * 100% = 1.8%
3. Some time passes, John hasn't been trading but the prices of his assets have changed.
Let's suppose that ETC/USD went down while ETH/USD went up.Current Price ($) for ETH is now $1200 and both P/L values will change accordingly.
ETH P/L ($) is now $2000:
($1200 - $1100) * 20 = $2000
ETH P/L (%) is now +9.09%:
($1200 / $1100 - 1) * 100% = 9.09%
4. John decides to add more Funds to his account and transfers an additional 30 ETH from his Wallet.
First and foremost it will affect the Open Price ($) for ETH. This will be recalculated using the Open Price formula:
(20 * $1100 + 30 * $1200) / 50 = $1160
- 20 is the initial amount of ETH before the transfer. It had an opening price of $1100.
- 30 is the amount of ETH that was transferred to the Portfolio. It had an opening price of $1200.
- 50 is the total amount of ETH in the Portfolio now.
- $1160 is the open price of this asset after the transfer.
This change doesn't affect P/L ($):
($1200 - $1160) * 50 = $2000
But this does affects P/L (%) since it relies on Open Price which has since been changed due to the transfer.
ETH P/L (%) is now +3.44%:
($1120/$1160 - 1)*100% = 3.44%
5. John spends 25 ETH to buy 100 LTC.
Since the amount of ETH has changed from 50 to 25, P/L ($) is now $1000:
($1200 - $1160) * 25 = $1000
P/L (%) doesn't change because the ETH price hasn't changed:
($1120 / $1160 - 1) * 100% = 3.44%
6. John transfers 20 ETH from Portfolio to Wallet before any price changes occur.
Unlike transfers to Portfolio, transferring funds out of it doesn't affect P/L (%) since the prices remain the same, this does however affect P/L ($).
P/L ($) for ETH after the transfer is:
($1200 - $1160) * 5 = $200