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)

免責聲明

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