OPEN-SOURCE SCRIPT

Z-Score of RSI

89
//version=5
indicator("Z-Score of RSI", overlay=false)

// Tham số
rsi_length = input.int(14, "RSI Length")
z_length = input.int(60, "Z-Score Period")

// Tính RSI
rsi = ta.rsi(close, rsi_length)

// Tính Z-Score
mean_rsi = ta.sma(rsi, z_length)
std_rsi = ta.stdev(rsi, z_length)
z_rsi = (rsi - mean_rsi) / std_rsi

// Vẽ biểu đồ
plot(z_rsi, color=color.new(color.aqua, 0), linewidth=2, title="Z-Score(RSI)")
hline(0, "Mean", color=color.gray)
hline(2, "Overbought (+2σ)", color=color.red)
hline(-2, "Oversold (-2σ)", color=color.lime)

// Cảnh báo (tuỳ chọn)
bgcolor(z_rsi < -2 ? color.new(color.lime, 85) : na)
bgcolor(z_rsi > 2 ? color.new(color.red, 85) : na)

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.