I'm trying to build a strategy and backtested where price has to close 2 consecutive times above the SMA 10 and SMA 12 then enter long and then exit on 2 closes below.
NinjaSupport gave me the example below but it does not work.
Can anyone shed some light?
// Condition set 1
if (CrossAbove(SMA(10), SMA(12), 1)
&& Variable0 > 0)
{
EnterLong(DefaultQuantity, "");
}
// Condition set 2
if (CrossAbove(SMA(10), SMA(12), 1))
{
Variable0 = 1;
}
Comment