OPEN-SOURCE SCRIPT
已更新

RSI Alerts

41
//version=5
indicator("RSI Alerts", shorttitle="RSI Alerts", overlay=false)

// — INPUT
len = input.int(14, "RSI Length")

// — CÁLCULO
r = ta.rsi(close, len)

// — PLOT RSI Y BANDAS
plot(r, "RSI", color=#7E57C2)
hline(80, "Overbought", color=color.red, linestyle=hline.style_dashed)
hline(50, "Middle", color=color.gray, linestyle=hline.style_solid)
hline(20, "Oversold", color=color.green, linestyle=hline.style_dashed)

// — ALERTAS INTERNAS (usa UNA sola ranura de alerta)
if ta.crossover(r, 80)
alert("🔔 RSI cruzó por encima de 80: " + str.tostring(r, format.mintick), alert.freq_once_per_bar)
if ta.crossunder(r, 20)
alert("🔔 RSI cruzó por debajo de 20: " + str.tostring(r, format.mintick), alert.freq_once_per_bar)
發行說明
//version=5
indicator("RSI with Native Alerts", shorttitle="RSI Alerts", overlay=false)

// — INPUT
len = input.int(14, title="RSI Length")

// — CÁLCULO RSI
r = ta.rsi(close, len)

// — PLOT RSI y BANDAS
plot(r, title="RSI", color=#7E57C2)
hline(80, title="Overbought", color=color.red, linestyle=hline.style_dashed)
hline(50, title="Middle", color=color.gray, linestyle=hline.style_solid)
hline(20, title="Oversold", color=color.green, linestyle=hline.style_dashed)

// — ALERTAS INTERNAS (usa UNA sola ranura de alerta)
if ta.crossover(r, 80)
alert("🔔 RSI crossed above 80: " + str.tostring(r, format.mintick), alert.freq_once_per_bar)
if ta.crossunder(r, 20)
alert("🔔 RSI crossed below 20: " + str.tostring(r, format.mintick), alert.freq_once_per_bar)

免責聲明

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