OPEN-SOURCE SCRIPT

RSI with Native Alerts

72
//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)

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.