OPEN-SOURCE SCRIPT

RSI Divergence

72
//version=5
indicator("RSI Divergence", overlay=false)

// Paramètres
length = input.int(14, title="RSI Length")
src = close

// Calcul du RSI avec SMA
rsiSMA = ta.rsi(src, length)
rsiSMA_smoothed = ta.sma(rsiSMA, length)

// Calcul du RSI avec WMA
rsiWMA = ta.rsi(src, length)
rsiWMA_smoothed = ta.wma(rsiWMA, length)

// Différence entre les deux RSI
rsiDiff = rsiSMA_smoothed - rsiWMA_smoothed

// Tracer la différence
plot(rsiDiff, title="RSI Divergence", color=color.blue)

// Tracer une ligne à zéro pour référence
hline(0, "Zero Line", color=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.