Similar to a supertrend in many aspect, this indicator act as a trend following system by itself. Based on a 89 Weighted moving average by default, the trend reverse is triggered by the crosses of the high or low with the Aktivator line. I changed a bit the RETURN instruction to show 2 different colors.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
//parameters // x = 89 // gg = 4 // rr = 11 // factor = 1 a = round(WeightedAverage[x](close)) green = a[round(x/gg)] red = a[round(x/rr)] if red > green then up1 = red dn1 = green elsif red < green then up1 = green dn1 = red endif atr = AverageTrueRange[14](close) up = up1+(atr*factor) dn = dn1-(atr*factor) once trend=1 if high>up[1] then trend=1 elsif low<dn[1] then trend=-1 endif if trend<0 and trend[1]>0 then flag=1 else flag=0 endif if trend>0 and trend[1]<0 then flagh=1 else flagh=0 endif if trend>0 and dn<dn[1] then dn=dn[1] endif if trend<0 and up>up[1] then up=up[1] endif if flag=1 then up=up1+(atr*factor) endif if flagh=1 then dn=dn1-(atr*factor) endif if trend=1 then super=dn else super=up endif return super coloured by trend as "89WMA Aktivator" |
//Indicator form the Kevin Britains archive.
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Hello,
Congratulations and thank you for this work.
I do not understand one thing, however:
if I change Green shift (gg variable, 4 by default) or Red shift (rr variable, 11 by default), the indicator disappears from the graph.
Even adding in the code an “if barindex> x + gg + rr + factor then …. endif”.
Many thanks in advance if you have any idea to solve this problem.