i've a very stupid problem, but i don't find anything to resolve it.
I want to stop my strategy when i arrive at 20 points target (and not in currency).
When i'm in position, i have to calculate te cumprofit realized and unrealized:
realized :
Performance.RealtimeTrades.TradesPerformance.Point s.CumProfit ;
unrealized: (when i'm in position)
Position.GetProfitLoss(Close[0],PerformanceUnit.Points);
and check total cumprofit in this mode:
if ((realized+ unrealized) >= maxProfit || (realized+ unrealized) <= maxLoss)
stopStraetgy();
maxProfit and maxLoss is points (like 20).
the issue is:
on instruments YM or other the code work fine,
in others instruments (like 6J,6E) this code not work beacuase the return in points of the realized or unrealized isn't an integer value but decimal value! (0,79999 an not 8 points of unrealized/realized !)
how to resolve it??
thanks!!
PS: i get the same problem when i go in the panel "Account performance" -> Gen the statistics and view daily trades...

Comment