Can anyone please help with where I am going wrong. Still new to this. Thank you in advance
i1 = SuperTrend[3.75,10]
i2 = ExponentialAverage[15](i1)
i3 = (i1 – i1[1])/i1*100
linemid = 0
RETURN i2 coloured(147,112,216) as “EMA”
IF i1 > i2 and i3 > linemid THEN
DRAWARROWUP(barindex, xlow-.005)
backgroundcolor(204,255,204)
ELSIF i1 < i2 and i3 < linemid THEN
DRAWARROWDOWN(barindex, xhigh+.005)
backgroundcolor(255,204,204)
ENDIF
RETURN ST as “Supertrend”
For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<
Use a more meaningful title, othe than generic help. Thank you. 🙂
What error have you been reported and what doesn’t it do that you want, instead?
At first sight there cannot be twice RETURN lines in an indicator, but that should hgave been reported, hasn’t it?
How are xhigh and xlow defined?
With this if..then statement no value should be displayed under “linemid”, since Supertrend and EMA always use values over 0.
If you want to display Supertrend and EMA, it looks like it is displayed.
i1 = SuperTrend[3.75,10]
i2 = ExponentialAverage[15](i1)
i3 = (i1 - i1[1])/i1*100
RETURN i1 as "Supertrend", i2 as "EMA", i3 as "Wert"