I just wanted to double check with you that the code below does the following:
EXIT TRADE IF AFTER N BARS THE TRADE IS IN LOSS
if(Position.MarketPosition != MarketPosition.Flat
&& BarsSinceEntry() >= n
&& Position.GetProfitLoss(Close[0], PerformanceUnit.Points) <= 0)
{
ExitLong();
ExitShort();
}

Comment