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.
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?
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)