regina.klosterman

RSI on Bollinger Bands by Snabbel

27
RSI on Bollinger Bands V.2
สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
//
// @author Snabbel
// RSI on Bollinger Bands
// 
study(title = "RSI on Bollinger Bands", shorttitle="RSI+BB")
source = close
RSI_length = input(14, minval=1)
BB_length = input(50, minval=40, maxval=50)
BB_stdDev = input(2.1, minval=2.0, maxval=2.1)
HighlightBreaches=input(true, title="Highlight Oversold/Overbought?", type=bool)

rsi_s = rsi(source, RSI_length)
plot(rsi_s, color=black, linewidth=2)


band4 = hline(80, title="Upper Line", linestyle=dashed, linewidth=3, color=red)
band3 = hline(55, title="Upper Line", linestyle=dashed, linewidth=3, color=red)
band2 = hline(50, title="Upper Line", linestyle=dashed, linewidth=3, color=red)
band1 = hline(45, title="Upper Line", linestyle=dashed, linewidth=3, color=red)
band0 = hline(20, title="Lower Line", linestyle=dashed, linewidth=3, color=lime)
fill(band1, band2, color=purple, transp=90)
fill(band2, band3, color=purple, transp=90)

bb_s = rsi_s
basis = sma(bb_s, BB_length)
dev = BB_stdDev * stdev(bb_s, BB_length)
upper = basis + dev
lower = basis - dev
plot(basis, color=red)
p1 = plot(upper, color=blue)
p2 = plot(lower, color=blue)
fill(p1,p2, blue)

b_color = (bb_s > upper) ? red : (bb_s < lower) ? green : na
bgcolor(HighlightBreaches ? b_color : na)