Profit and loss calculation