Total profit/loss in your account currency is defined as the total cash flow at the opening, evaluated against the total (estimated) cash flow at closing.
For a stock, this is loosely speaking the amount you receive when you sell your stocks (net of commission, exchange fee and tax) vs. the amount you originally paid for the stocks (including commission, exchange fee and tax). In case the stock is traded in a currency different from your account currency, fluctuations in the currency rate will affect the total profit/loss.
Formally, total profit/loss can be expressed as:
Re-arranging the expression above (and skipping the algebra), we can express total profit/loss in your account currency as the sum of:
- Price fluctuations in the instrument > Trade profit/loss
- Currency fluctuations between your account currency and your instrument currency > Conversion profit/loss
- Commission, exchange fee, tax etc. > Cost loss
Please see this example.