I've got a strategy which uses MAs I've created. Trades are triggered based upon, as per usual, cross above and below. It works well as a simple Buy and Sell so you're always in the market however I'm trying to incorporate Stop orders so that it only goes long at 1 pip above the high of the signal candle and vice-versa for short orders. I've got it to work to the extent that if the proceeding candle goes 1 pip higher/lower it will enter the order however the Stop order appears to be eliminated after this, so if the next candle goes higher/lower than the signal candle no order is entered. I'd like the Stop order to stay active until the Fast and Slow MA's cross each other again at which point a new Stop order is created. At the moment my code looks like the following:
if (CrossAbove(MAseries1, MAseries2, 1))
{EnterLongStop(1, High[1]+0.0001, "L");
ExitShort();}
else if (CrossBelow(MAseries1, MAseries2, 1))
{EnterShortStop(1, Low[1]-0.0001, "S");
ExitLong();}
Kind Regards,
Harry Seager

Comment