The target needs to be adjusted on every bar update since the SMA is adjusting every bar although this code seems to set target at the SMA at the time of the Entry and maintain that target price even though the SMA moves. How can I have my target change to the new SMA on every bar update? I considered using just close > SMA...exit but that will only execute on bar close and I need the target set so if price hits the SMA during bar formation, I exit the position. Thanks.
if (Close[0]>Open[0]) { EnterLong(1, "LongEntry"); } //Exit Condition set 1 if (GetCurrentAsk() == SMA(14)[0]) { ExitLong("LongExit", "LongEntry"); }
Comment