It won't exit if the 5 SMA is below the close? I have attached a picture below
// Condition set 1
if (Close[0] > SMA(200)[0]
&& Close[0] < SMA(5)[0]
&& High[2] < High[3]
&& Low[2] < Low[3]
&& Low[1] < Low[2]
&& High[1] < High[2]
&& High[0] < High[1]
&& Low[0] < Low[1])
{
EnterLongLimit(DefaultQuantity, Close[0], "");
}
// Condition set 2
if (Close[0] > SMA(5)[0])
{
ExitLongLimit(Close[0], "", "");
}
}
If you look at the attached picture the buy at 50.21 should have exited 7 or 9 bars later when it closed higher then the 5 day SMA but it didn't it waited much longer
Comment