I want to close the position once both PnL are beyond a Profit, so I watch the PnL of both operations to wait for the right moment.
My problem is that I'm getting wrong PnL from the first instrument:
double Pnl1 = Positions[0].GetProfitLoss(Close[0], PerformanceUnit.Currency);
double Pnl2 = Positions[1].GetProfitLoss(Close[0], PerformanceUnit.Currency);
Print("AvPr: "+ Positions[0].AvgPrice +" | "+ Positions[1].AvgPrice );
Print("Open PnL: "+ Pnl1 +" | "+ Pnl2);
AvPr: 1228 | 0 Open PnL: 242050 | 0 AvPr: 1228 | 0 Open PnL: 242025 | 0 AvPr: 1228 | 0 Open PnL: 242050 | 0 AvPr: 1228 | 0 Open PnL: 242075 | 0 AvPr: 1228 | 0 Open PnL: 242050 | 0 AvPr: 1228 | 0 Open PnL:[COLOR="DarkGreen"] -25[/COLOR] | 0 AvPr: 1228 | 0 Open PnL: 242050 | 0
What am I doing wrong?

P.S.: There is no problem for the second instrument PnL once it gets open.


Comment