Below is the code that I am using but it is not working.
I have three IF statements:
1.) Check to see if a position is open
2.) Check to see if I have already set the trailing stop
3.) Check to see if the trade is three points in my favor
I have verified that the innermost IF statement is being triggered but it seems it is being triggered multiple times resetting the Trailing Stop each time.
if (Position.MarketPosition != MarketPosition.Flat)
{
if (bolTrailStop == false)
{
if (Position.GetProfitLoss(Close[0], PerformanceUnit.Points) > 3)
{
SetTrailStop(CalculationMode.Ticks, 12);
bolTrailStop = true;
}
}
else
bolTrailStop = false;
}
Is there a better way to check if a Trailing Stop is already in place rather then setting a boolean value?

Comment