When a position turns into a deal, how to get the most recent deal's profit/loss $ amount

 
Utilizing the Sendmail function and i'm having trouble getting this right