vdubus

VDUB_REJECTION_SPIKE_V4 UPDATED / Re vamped & de cluttered

*Updated

开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?
//@version=2
study("VDUB_REJECTION_SPIKE_V4", overlay=true, shorttitle="VDUB_REJECTION_SPIKE_V4")
//====================channel 1==========================
len = input(55, minval=1, title="EMA LENGTH")
src = input(close, title="Source 1")
out = ema(src, len)
plot(out, title="EMA", color=blue, style=circles, linewidth=1)
last8h = highest(close, 13)
lastl8 = lowest(close, 13)

plot(last8h, color=black, linewidth=1, title="Upper channel 1")
plot(lastl8, color=black, linewidth=1, title="Lower channel 1")

bearish = cross(close,out) == 1 and close[1] > close 
bullish = cross(close,out) == 1 and close[1] < close 

//======================channel 2==================================
len0 = 34
src0 = input(close, title="Source 2")
out0 = sma(src0, len0)
last8h0 = highest(close, 34)
lastl80 = lowest(close, 34)
bearish0 = cross(close,out) == 1 and falling(close, 1)
bullish0 = cross(close,out) == 1 and rising(close, 1)
channel20=input(true, title="Bar Channel On/Off")
ul20=plot(channel20?last8h0:last8h0==nz(last8h0[1])?last8h0:na, color=black, linewidth=2, style=linebr, title="Upper channel 2", offset=0)
ll20=plot(channel20?lastl80:lastl80==nz(lastl80[1])?lastl80:na, color=black, linewidth=2, style=linebr, title="Upper channel 2", offset=0)

// Moddified [RS]Support and Resistance V0
RST = input(title='Support / Resistance length:', type=integer, defval=16)     //
RSTT = valuewhen(high >= highest(high, RST), high, 0)
RSTB = valuewhen(low <= lowest(low, RST), low, 0)
RT2 = plot(RSTT, color=RSTT != RSTT[1] ? na : red, linewidth=2, offset=+0)
RB2 = plot(RSTB, color=RSTB != RSTB[1] ? na : green, linewidth=2, offset=0)

// ZIGZAG -----------------------------------------------//
length = input(4, title="Zigzag Length")
hls = rma(hl2, length)
isRising = hls >= hls[1]

zigzag1 = isRising and not isRising[1] ? lowest(length) :  not isRising and isRising[1] ? highest(length) : na
plot(zigzag1, color=blue, style=line, linewidth=2)
////////////////////////////////////////////////////