...
if (Position.GetProfitLoss(Highs[1][0], PerformanceUnit.Points) > pointsTrailLong)
{
Print("Setting trail stop long");
Print(stopTrailPercentLong);
SetTrailStop(CalculationMode.Percent, stopTrailPercentLong);
}
And it was being executed. The Output window shows:
Setting trail stop long
1
But the 1 should be 0.10. Its defined as a double not an int. Is it that the Print statement is rounding 0.10 to 1 OR is there a problem with the 'set' statement and 'Max' function?
Brooks
private double stopTrailPercentLong = 0.10;
public double StopTrailPercentLong
{
get { return stopTrailPercentLong; }
set { stopTrailPercentLong = Math.Max(1, value); }
}
Comment