kingthies

Consolidation Ranges [kingthies]

kingthies 업데이트됨   
Consolidation Range Analysis
Published by Eric Thies, January 2021

Indicator Summary
  • This tool calculates, analyzes and plots the visualization of a relative range over a given period of time
  • By adding to charts, users are enabled to see the impulsive nature of market cycles, along with their efforts to consolidate thereafter
  • The default period is 30, and should be adjusted to users preference
  • The default input is the current close price, on the chosen timeframe of the chart


Script Source

// [pine]
//@version=4
//© kingthies || This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org/MPL/2.0/
study("Consolidation Ranges [kingthies]", shorttitle="CR [kingthies]", overlay=true)

// !<------ User Inputs -----> 
src = input(close, title='Range Input (Default set to Close'), lengthEMA=input(30,title='Length'),zoneToggle = input(true, title="Toggle Zone Highlights"), iCol = color.new(#FFFFFF, 100), 

// !<---- Declarations & Calculations ---- > 
trndUp = float(na),trndDwn = float(na), mid = float(na), e = ema(src, lengthEMA)
trndUp := src < nz(trndUp[1]) and src > trndDwn[1] ? nz(trndUp[1]) : high, trndDwn := src < nz(trndUp[1]) and src > trndDwn[1] ? nz(trndDwn[1]) : low, mid := avg(trndUp, trndDwn)

// !< ---- Plotting -----> 
highRange = plot(trndUp == nz(trndUp[1]) ? trndUp : na, color=color.white, linewidth=2, style=plot.style_linebr, title="Top of Period Range")
lowRange = plot(trndDwn == nz(trndDwn[1]) ? trndDwn : na, color=color.white, linewidth=2, style=plot.style_linebr, title="Bottom of Period Range")
xzone = plot(zoneToggle ? src > e ? trndDwn : trndUp : na, color=iCol, style=plot.style_circles, linewidth=0, editable=false)
fill(highRange, xzone, color=color.lime,transp=70), fill(xzone, lowRange, color=color.red,transp=70)
// [/pine]

릴리즈 노트:
Upgraded to pine v5

Eric Thies
오픈 소스 스크립트

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

면책사항

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

차트에 이 스크립트를 사용하시겠습니까?