I have a strategy that is working fine in Back Testing but creates additional unintended trades when running live. Please see below the simple code:
================================
if (Closes[0][0] < SMA(10)[0]) )
{
EnterShort(2, "S1");
entryPriceS1=Close[0];
return;
}
if (Position.MarketPosition == MarketPosition.Short)
{
if( ((entryPriceS1-Closes[0][0]) >10))
ExitShort(1,"XS1", "S1");
}
if (Highs[0][0] > (SMA(10)[1]))
ExitShort("XS2", "S1");
}
if((Closes[0][0]) > (SMA(10)[0]-2) )
ExitShort("XS3", "S1");
}
}
Issue. It closes the Short S1 trades but also enters LONG trades like XS1, XS2, XS3. And, it is random.
Any help is greatly appreciated.
Thanks!

Comment