RicardoSantos

[RS]Multiple ATR Analysis V1

UPDATE:
• added a mean version of atr using fractional lengths (requested by IvanLabrie):
• uses slow length property for setup.
• added Average Dayly Range (ADR) (requested by IvanLabrie)
• uses fast length property for setup.
• added Average Weekly Range (AWR)
• uses fast length property for setup.
• added Average Monthly Range (AMR)
• uses fast length property for setup.
• added Average Yearly Range (AYR)
• uses fast length property for setup.
Open-source Skript

Ganz im Spirit von TradingView hat der Autor dieses Skripts es als Open-Source veröffentlicht, damit Trader es besser verstehen und überprüfen können. Herzlichen Glückwunsch an den Autor! Sie können es kostenlos verwenden, aber die Wiederverwendung dieses Codes in einer Veröffentlichung unterliegt den Hausregeln. Sie können es als Favoriten auswählen, um es in einem Chart zu verwenden.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.

Möchten Sie dieses Skript auf einem Chart verwenden?
study(title="[RS]Multiple ATR Analysis V1")
fast_length = input(title='Fast ATR Length:', defval=14)
slow_length = input(title='Slow ATR Length:', defval=100)
SHOW_CATR = input(title='Show Cumulative ATR?:', defval=true)
SHOW_MATR = input(title='Show Mean ATR(fractional slow length)?:', defval=true)
SHOW_ADR = input(title='Show Average Dayly Range(fast length)?:', defval=true)
SHOW_WDR = input(title='Show Average Weekly Range(fast length)?:', defval=false)
SHOW_MDR = input(title='Show Average Monthly Range(fast length)?:', defval=false)
SHOW_YDR = input(title='Show Average Yearly Range(fast length)?:', defval=false)

catr = not SHOW_CATR ? na : cum(high-low)/(n+1)
matr = not SHOW_MATR ? na : (atr(round(slow_length*0.05))+atr(round(slow_length*0.25))+atr(round(slow_length*0.5))+atr(slow_length))/4
adr = not SHOW_ADR ? na : security(tickerid, 'D', atr(fast_length))
wdr = not SHOW_WDR ? na : security(tickerid, 'W', atr(fast_length))
mdr = not SHOW_MDR ? na : security(tickerid, 'M', atr(fast_length))
ydr = not SHOW_YDR ? na : security(tickerid, '12M', atr(fast_length))

plot(atr(fast_length), title='Fast ATR', color=red, trackprice=true)
plot(atr(slow_length), title='slow ATR', color=maroon, trackprice=true)
plot(catr, color=blue, title='CATR', trackprice=true)
plot(matr, color=navy, title='MATR', trackprice=true)
plot(adr, color=black, title='ADR', trackprice=true)
plot(wdr, color=gray, title='AWR', trackprice=true)
plot(mdr, color=silver, title='AMR', trackprice=true)
plot(ydr, color=aqua, title='AYR', trackprice=true)
hline(0, color=black)