OPEN-SOURCE SCRIPT
CM_Williams_Vix_Fix Market Top Winit

//version=5
indicator('CM_Williams_Vix_Fix Market Top', overlay=false)
// Inputs
pd = input(22, title='LookBack Period Standard Deviation High')
bbl = input(20, title='Bollinger Band Length')
mult = input.float(2.0, minval=1, maxval=5, title='Bollinger Band Standard Deviation Up')
lb = input(50, title='Look Back Period Percentile High')
ph = input(0.85, title='Highest Percentile - 0.90=90%, 0.95=95%, 0.99=99%')
pl = input(1.01, title='Lowest Percentile - 1.10=90%, 1.05=95%, 1.01=99%')
hp = input(false, title='Show High Range - Based on Percentile and LookBack Period?')
sd = input(false, title='Show Standard Deviation Line?')
// Core Calculation (Inverted for Market Top)
wvf_top = (close - ta.lowest(close, pd)) / ta.lowest(close, pd) * 100 // Detect extreme highs
sDev = mult * ta.stdev(wvf_top, bbl)
midLine = ta.sma(wvf_top, bbl)
lowerBand = midLine - sDev
upperBand = midLine + sDev
rangeHigh = ta.highest(wvf_top, lb) * ph
rangeLow = ta.lowest(wvf_top, lb) * pl
// Color logic: highlight extreme highs
col = wvf_top >= upperBand or wvf_top >= rangeHigh ? color.red : color.gray
// Plots
plot(wvf_top, title='Williams Vix Fix Market Top', style=plot.style_histogram, linewidth=3, color=col)
// Optional plots
plot(hp ? rangeHigh : na, title='Range High Percentile', style=plot.style_line, linewidth=2, color=color.new(color.orange, 0))
plot(hp ? rangeLow : na, title='Range Low Percentile', style=plot.style_line, linewidth=2, color=color.new(color.orange, 0))
plot(sd ? upperBand : na, title='Upper Band', style=plot.style_line, linewidth=2, color=color.new(color.aqua, 0))
plot(sd ? lowerBand : na, title='Lower Band', style=plot.style_line, linewidth=2, color=color.new(color.aqua, 0))
indicator('CM_Williams_Vix_Fix Market Top', overlay=false)
// Inputs
pd = input(22, title='LookBack Period Standard Deviation High')
bbl = input(20, title='Bollinger Band Length')
mult = input.float(2.0, minval=1, maxval=5, title='Bollinger Band Standard Deviation Up')
lb = input(50, title='Look Back Period Percentile High')
ph = input(0.85, title='Highest Percentile - 0.90=90%, 0.95=95%, 0.99=99%')
pl = input(1.01, title='Lowest Percentile - 1.10=90%, 1.05=95%, 1.01=99%')
hp = input(false, title='Show High Range - Based on Percentile and LookBack Period?')
sd = input(false, title='Show Standard Deviation Line?')
// Core Calculation (Inverted for Market Top)
wvf_top = (close - ta.lowest(close, pd)) / ta.lowest(close, pd) * 100 // Detect extreme highs
sDev = mult * ta.stdev(wvf_top, bbl)
midLine = ta.sma(wvf_top, bbl)
lowerBand = midLine - sDev
upperBand = midLine + sDev
rangeHigh = ta.highest(wvf_top, lb) * ph
rangeLow = ta.lowest(wvf_top, lb) * pl
// Color logic: highlight extreme highs
col = wvf_top >= upperBand or wvf_top >= rangeHigh ? color.red : color.gray
// Plots
plot(wvf_top, title='Williams Vix Fix Market Top', style=plot.style_histogram, linewidth=3, color=col)
// Optional plots
plot(hp ? rangeHigh : na, title='Range High Percentile', style=plot.style_line, linewidth=2, color=color.new(color.orange, 0))
plot(hp ? rangeLow : na, title='Range Low Percentile', style=plot.style_line, linewidth=2, color=color.new(color.orange, 0))
plot(sd ? upperBand : na, title='Upper Band', style=plot.style_line, linewidth=2, color=color.new(color.aqua, 0))
plot(sd ? lowerBand : na, title='Lower Band', style=plot.style_line, linewidth=2, color=color.new(color.aqua, 0))
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.