PROTECTED SOURCE SCRIPT

RSI Avancé + EMA 50 + Divergence Blumansa

//version=5
indicator("RSI Avancé + EMA 50 + Divergence", overlay=true)

// Paramètres utilisateur
rsi_length = input.int(14, title="Longueur RSI")
ema_length = input.int(50, title="Longueur EMA")
divergence_sensitivity = input.int(5, title="Sensibilité Divergence")

// Calcul des indicateurs
rsi = ta.rsi(close, rsi_length)
ema50 = ta.ema(close, ema_length)

// Tendance RSI (couleur dynamique)
color_rsi = rsi > 50 ? color.green : color.red

// Détection de divergence haussière
lowest_rsi = ta.lowest(rsi, divergence_sensitivity)
lowest_close = ta.lowest(close, divergence_sensitivity)
bull_div = (lowest_rsi < rsi and lowest_close < close)

// Détection de divergence baissière
highest_rsi = ta.highest(rsi, divergence_sensitivity)
highest_close = ta.highest(close, divergence_sensitivity)
bear_div = (highest_rsi > rsi and highest_close > close)

// Signaux visuels
plot(ema50, title="EMA 50", color=color.blue, linewidth=2)
plot(rsi, title="RSI", color=color_rsi, style=plot.style_line)

// Alertes visuelles
plotshape(series=bull_div ? 1 : na, location=location.belowbar, color=color.green, style=shape.labelup, title="Divergence Haussière")
plotshape(series=bear_div ? 1 : na, location=location.abovebar, color=color.red, style=shape.labeldown, title="Divergence Baissière")

// Alerte sonore
alertcondition(bull_div, title="Alerte Divergence Haussière", message="RSI Divergence haussière détectée !")
alertcondition(bear_div, title="Alerte Divergence Baissière", message="RSI Divergence baissière détectée !")

// Zone neutre RSI
hline(50, "Seuil RSI 50", color=color.gray)

คำจำกัดสิทธิ์ความรับผิดชอบ