OPEN-SOURCE SCRIPT
RSI with Native Alerts

//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)
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的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。