Hallo
ich habe im forum hier einen Indikator gefunden, den ATR Stop loss finder.
diesen möchte ich als Bedingung für den einstieg und auch als Stop loss benutzen
Wenn ich diesen im code anlege, dann kommt als Meldung ignored und das der Indikator nicht gefunden werden kann.
Was muss ich tun, damit das funktioniert??
Hier der code des Indikators
// HstopL v1 20-07-2022 druby
//
// Dynamic variable settings
// NAME Type Default (comment)
// ——————————————————————-
// Period integer 14 lookback range
// Mul Decimal 1.5 multiply the ATR value by:
defparam drawonlastbaronly = true
// input limiters – limit the range of values used in code calculations
period = max(min(Period,barindex),1) // (1 to barindex)
mul = max(min(Mul,10),0) // (0 to 10)
//true range calculation
tr1 = abs(high – low)
tr2 = abs(high – close[1])
tr3 = abs(low – close[1])
trf = max(tr3,max(tr1,tr2)) // absolute maximum of (tr1,tr2,tr3)
if barindex > period then // delay average calculations till enough bars avaliable
// manual RMA calculation
k= 1/(period)
RMA = range * k + RMA[1] * (1–k)
xma = RMA
// Atr, HLline calculations
// Atr value
a = xma * mul
// Atr +/- high/low values
x = xma * mul + high
x2 = low – xma * mul
endif // barindex > period
// Drawing main text and values
Drawtext(“ATR: #a#”,–255,10,dialog,bold,20)anchor(bottom) coloured (“dodgerblue”)
Drawtext(“H: #x#”, –70,10,dialog,bold,20)anchor(bottom) coloured (“red”)
Drawtext(“L: #x2#”, 100,10,dialog,bold,20)anchor(bottom) coloured (“teal”)
// draw averageType label
Drawtext(“RMA”,40,10,dialog,bold,20)anchor(bottomLeft) coloured (“grey”)
// return (atr * mul) high and low lines
return x as“Hstop”,x2 as“Lstop”