Tool
Profit and loss
The sign follows the direction. A long gains when the exit is above the entry. Costs such as spread and swap are not included unless you have already put them into the prices.
The formula, in words
For a long, the price difference is the exit minus the entry. For a short, it is the entry minus the exit. Profit or loss in the quote currency equals that difference times the units. Divide the difference by the pip size to read it in pips. A user-supplied rate converts the result when the account currency is not the quote currency.