That's the summary of what I am trying to do. The problem I am specifically having is sensing, in the case of an order execution, whether it was a long entry or a short entry so I can then implement stops and targets for a long or a short. It is that selection that is causing me the grief here, determining whether I need a short set of profit and stop or a long set. To set the stop and profit I just use my ATRTick indicator which I know works because I have been using them in an earlier version which runs fine, but has this problem with the trend change. Here's the construct I use for setting the stop and profit for a long entry:
stopOrder = ExitLongStop(0, true, 1, execution.Price - ATRTicks(14).Max_ATR[0] , "long_stop", "LAbv_Band"); targetOrder = ExitLongLimit(0, true, 1, execution.Price + ATRTicks( 14).ATRinTicks[0] - Offset * TickSize, "long_target", "LAbv_Band");

Comment