I am using an ATR trailing stop for exits in a strategy. I used the ATRTrailing.cs for your website in order to program it. My problem is that the stop does not work when I have a short entry order, whereas it works normally when I have a long entry order. The code I am using is:
ATRTrailingStopLower = ATRTrailing(ATRTimes, ATRPeriod, ATRRatched).Lower;
ATRTrailingStopUpper = ATRTrailing(ATRTimes, ATRPeriod, ATRRatched).Upper;
_longATRStop = ExitLongStopMarket(_ATRTrailingStopUpper[0], LongTrailingStop, LongEntry);
_shortATRStop = ExitShortStopMarket(_ATRTrailingStopLower[0], ShortTrailingStop, ShortEntry);
could you please tell me why it does not work for both sides even though the code is the same?
Thank you.
Comment