None of this is working. When I back test in the strategy analyzer I don't get a single stop exit, just a buy or sell on close. what am I doing wrong? I test to make sure the stop price is above or below the current ask or bid to make sure I'm not placing an illegal stop order. I have TraceOrders turned on and I see planty of stop orders going through wih the occassional exit order placed without and assocatied order, (not sure why that happens but I'm guessing it has to do with the imprefections of backtesting in the SA).
Any idea what I am messing up?
// Short Entry if(anaGaussianFilter(9, 3).Gaussian[0] <= anaSuperSmootherFilter(9, 3).SuperSmoother[0] && TriggerLinesDelta(20, 8).TL_Delta[0] < 0 && Falling(TriggerLinesDelta(20, 8).TL_Delta) == true && Position.MarketPosition == MarketPosition.Flat && ((ToTime(Time[0]) > TT1_Start && ToTime(Time[0]) < TT1_End ) || (ToTime(Time[0]) > TT2_Start && ToTime(Time[0]) < TT2_End ))) { EnterShort(DefaultQuantity, "Sc2_S"); ExitShortStop(High[1] + +2 * TickSize, "Sc2_SX", "Sc2_S"); Variable1 = High[1] + +2 * TickSize; }
// Lock in Profit on Short Position if (Position.MarketPosition == MarketPosition.Short && Close[0] < Position.AvgPrice - Take_Profit * TickSize && Variable1 > GetCurrentAsk() && !controlOne) { ExitShortStop(High[0] + 2 * TickSize, "Sc2_SPX", "Sc2_S"); Variable1 = High[0] + 2 * TickSize; controlOne = false; }
Comment