How to calculate total PnL in mql5

 
Hi there, any one can help with a well detailed code to calculate total profit and loss including swap and commission. Help will be much appreciated. 
Reason: