OPEN-SOURCE SCRIPT

Swing RSI Panel

57
//version=6
indicator("Swing RSI Panel", overlay=false)

// RSI Settings
rsiLength = input.int(14, "RSI Length")
rsiOversold = input.int(40, "RSI Oversold")
rsiOverbought = input.int(60, "RSI Overbought")

// Calculate RSI
rsiValue = ta.rsi(close, rsiLength)

// Plot RSI
plot(rsiValue, "RSI", color=color.purple, linewidth=2)
hline(50, "Midline", color=color.gray, linestyle=hline.style_dotted)
hline(rsiOversold, "Oversold", color=color.green, linestyle=hline.style_dotted)
hline(rsiOverbought, "Overbought", color=color.red, linestyle=hline.style_dotted)

// Fill zones
bgcolor(rsiValue >= rsiOverbought ? color.new(color.red, 90) :
rsiValue <= rsiOversold ? color.new(color.green, 90) : na, title="RSI Zones")

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。