I am trying to achieve sth like this:
When position is Long - ignore first crossbelow of two SMA's and exit on second crossbelow.
I wrote a strategy (code below) but it exits on first crossbelow every time. Logic looks good for me however it doesnt work. Any suggestion how to make it work would be very welcome.
Regards
if (Position.MarketPosition == MarketPosition.Flat)
{ second = false;}
if (Position.MarketPosition == MarketPosition.Long
&& CrossBelow(SMA(3), SMA(14), 1)
&& second == false)
{second = true;}
if (Position.MarketPosition == MarketPosition.Long
&& CrossBelow(SMA(3), SMA(14), 1)
&& second == true)
{ExitLong("","");}
if (High[0] > High[1])
{
EnterLong(1, "Long");
}

Comment