The code below will compile, but not optimise any results in ver 6.5.0.4 BETA but will optimise in NT ver 6 ?? Moreover if the lines referencing the PerformanceUnit.Currency method are deleted then the optimiser does not freeze up !
Can anyone confirm my results? Thanks.
protectedoverridevoid OnBarUpdate()
{ if (Position.MarketPosition == MarketPosition.Flat)EnterLong(1,"L");
if (Position.MarketPosition == MarketPosition.Long)
{
//double currency = 1;
double currency = Position.GetProfitLoss(Close[0], PerformanceUnit.Currency);
double percent = Math.Round(Position.GetProfitLoss(Close[0], PerformanceUnit.Percent),4);
double points = Math.Round(Position.GetProfitLoss(Close[0], PerformanceUnit.Points),4);
Print(CurrentBar);
Print("Currency = " + currency);
Print("Percent = " + percent);
Print("Points = " + points);
}
}
Comment