changes: strategy settings tweaked and Hull_MA_cross added to script
try this instead
which still has repaint problem but less so, just refresh page, if signal remains after 1 or 2 bars, then all good.
HullMA-cross-Strategy EA for MT4 available:
Save your time by having a robot trade for you, http://ss420fx.blogspot.co.nz FREE 1 month demo to make sure it works with your broker and chosen pairs.
dt = input(defval=0.0010, title="Decision Threshold", type=float, step=0.0001)
keh=input(title="Double HullMA Cross",type=integer,defval=3, minval=1)
confidence=(security(tickerid, 'D', close)-security(tickerid, 'D', close))/security(tickerid, 'D', close)
prediction = confidence > dt ? true : confidence < -dt ? false : prediction
plot(prediction and n1>n2? 1 : 0, color=lime, linewidth=1)