In a strategy I have coded a EnterLong(1000) on EURUSD.
The position is well displayed in the Positions tab of NT7, and the PnL is moving and does not equal 0.
In my code I call the following method but I always have 0 as profit and also 0 in quantity :
Print(Position.Instrument.FullName);
double profit = Position.GetProfitLoss(Close[0], PerformanceUnit.Currency);
Print("Close[0]=" + Close[0]); // Close[0] = GetCurrentBid()
Print("GetCurrentAsk=" + GetCurrentAsk());
Print("GetCurrentBid=" + GetCurrentBid());
Print(dt + " : profit=" + profit);
Print("Qty=" + Position.Quantity);
I would like to get the same PnL value as the one shown on the Positions tab...
Thanks

Comment