The formula to calculate the profit or loss of a CFD position is as follows:
Profit/Loss = (Close Price - Open Price) x Contract Size x Lots
When calculating a sell position, the position is in profit when the result is negative.
Any additional costs or fees, such as commissions or swap fees, will affect your overall profit or loss.