FXCloud

MTI Stochastic RSI with Color Bars and Zones

Plots the %D line of a Stochastic Oscillator calculated from the RSI of close of length 14.
Red Sell Zone above 80, candles paint red
Green Buy Zone below 20, candles paint green

สคริปต์โอเพนซอร์ซ

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

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

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

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
study(title="MTI Stochastic RSI", shorttitle="MTI Stoch RSI Color Zones")
//Inputs
src = input(close, title="RSI Source")
lengthRSI = input(14,title="RSI Length", minval=1)
smoothK = input(8,title="%K", minval=1)
smoothD = input(5,title="%D", minval=1)
Overbought=input(80)
Oversold=input(20)
//RSI Calculation
rsi1 = rsi(src, lengthRSI)
//StochRSI Calculation
k=100*(rsi1-lowest(rsi1,smoothK))/(highest(rsi1,smoothK)-lowest(rsi1,smoothK))
d=sma(k, smoothD)
//StochRSI Plot
//plot(k,title="%K",color=red)
plot(d, title="%D", color=blue)
//Buy and Sell zones
h0 = hline(Overbought,title="Overbought",color=red,linestyle=solid)
h1 = hline(Oversold,title="Oversold",color=lime,linestyle=solid)
h2=hline(100,color=black)
h3=hline(0,color=black)
fill(h2,h0, color=red, transp=80)
fill(h3,h1, color=lime, transp=80)
//Bar Color
SellZone()=> d>=Overbought
BuyZone()=> d<=Oversold
barcolor(BuyZone() ? lime : SellZone() ? red : na)