emma_olav

Indicador RSI de distintos Time frame

AMEX:SPY   SPDR S&P 500 ETF TRUST
Tratando de aprender pinescript hice este indicador para usar en Time frame DIARIO, y como aprendo de lo que comparten los que saben, también hago mi pequeño aporte.
Lo que muestra es un RSI semanal (lento) y un RSI de 4 horas (rápido).

//@version=3
study(title="2_RSI_TIME", shorttitle="2_RSI_TIME", overlay=false)

src = close,

len1 = input(14, minval=1, title="RSI Semanal")
len2 = input(14, minval=1, title="RSI 4 Horas")
len3 = input(14, minval=1, title="RSI")

up1 = rma(max(change(src), 0), len1)
down1 = rma(-min(change(src), 0), len1)
rsi1 = down1 == 0 ? 100 : up1 == 0 ? 0 : 100 - (100 / (1 + up1 / down1))

up2 = rma(max(change(src), 0), len2)
down2 = rma(-min(change(src), 0), len2)
rsi2 = down2 == 0 ? 100 : up2 == 0 ? 0 : 100 - (100 / (1 + up2 / down2))

up3 = rma(max(change(src), 0), len3)
down3 = rma(-min(change(src), 0), len3)
rsi3 = down3 == 0 ? 100 : up3 == 0 ? 0 : 100 - (100 / (1 + up3 / down3))

rsi_s = security(tickerid, '1W', rsi1)
rsi_d= security(tickerid, '240', rsi2)

plot(rsi_s, title='RSI Semanal', style=line, color=red)
plot(rsi_d, title='RSI 4 Horas', style=line, color=orange)
plot(rsi3, title='RSI', style=line, color=green)

band3 = plot(50, title="Lower Line", style=dashed, linewidth=1, color=gray)
Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.