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)

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.