OPEN-SOURCE SCRIPT
تم تحديثه

Bullish Divergence + Support Levels Custom

//version=5
indicator("Bullish Divergence + Support Levels", overlay=true)

// RSI Calculation
rsiLength = 14
rsi = ta.rsi(close, rsiLength)

// Detect Bullish Divergence
low1 = ta.lowest(low, 5)
low2 = ta.lowest(low, 5)[5]
rsiLow1 = ta.lowest(rsi, 5)
rsiLow2 = ta.lowest(rsi, 5)[5]

// Condition: Price Lower Low but RSI Higher Low (Bullish Divergence)
bullishDivergence = (low1 < low2) and (rsiLow1 > rsiLow2)

// Support Level Detection
supportLevel = ta.lowest(close, 20)

// Moving Averages for Trend Confirmation
ema50 = ta.ema(close, 50)
ema200 = ta.ema(close, 200)
trendConfirmation = close > ema50 and ema50 > ema200 // Strong uptrend confirmation

// Price Change % for Early Recovery
change1H = (close - close[60]) / close[60] * 100 // 1-hour change
change4H = (close - close[240]) / close[240] * 100 // 4-hour change
earlyRecovery = change1H > 0 or change4H > 0

// Final Buy Signal: Bullish Divergence + Support Level + Trend + Early Recovery
buySignal = bullishDivergence and close >= supportLevel and trendConfirmation and earlyRecovery

// Plot Buy Signal
plotshape(series=buySignal, location=location.belowbar, color=color.green, style=shape.labelup, title="BUY 🚀")
plot(supportLevel, color=color.blue, title="Support Level", linewidth=2)
plot(ema50, color=color.orange, title="50 EMA")
plot(ema200, color=color.red, title="200 EMA")
ملاحظات الأخبار
//version=5
indicator("Bullish Divergence + Support Levels with Buy/Sell Labels", overlay=true)

// RSI Calculation
rsiLength = 14
rsi = ta.rsi(close, rsiLength)

// Detect Bullish Divergence
low1 = ta.lowest(low, 5)
low2 = ta.lowest(low, 5)[5]
rsiLow1 = ta.lowest(rsi, 5)
rsiLow2 = ta.lowest(rsi, 5)[5]

// Condition: Price Lower Low but RSI Higher Low (Bullish Divergence)
bullishDivergence = (low1 < low2) and (rsiLow1 > rsiLow2)

// Support Level Detection
supportLevel = ta.lowest(close, 20)

// Moving Averages for Trend Confirmation
ema50 = ta.ema(close, 50)
ema200 = ta.ema(close, 200)
trendConfirmation = close > ema50 and ema50 > ema200 // Strong uptrend confirmation

// Price Change % for Early Recovery
change1H = (close - close[60]) / close[60] * 100 // 1-hour change
change4H = (close - close[240]) / close[240] * 100 // 4-hour change
earlyRecovery = change1H > 0 or change4H > 0

// Final Buy Signal: Bullish Divergence + Support Level + Trend + Early Recovery
buySignal = bullishDivergence and close >= supportLevel and trendConfirmation and earlyRecovery

// Sell Signal: Price drops below 50 EMA
sellSignal = ta.crossunder(close, ema50)

// Plot Buy & Sell Arrows
plotshape(series=buySignal, location=location.belowbar, color=color.green, style=shape.labelup, title="BUY 🚀")
plotshape(series=sellSignal, location=location.abovebar, color=color.red, style=shape.labeldown, title="SELL ❌")

// Add Labels for Buy & Sell Signals
labelPositionBuy = low - ta.atr(5)
labelPositionSell = high + ta.atr(5)

labelBuy = label.new(x=time, y=labelPositionBuy, text="BUY 🚀", color=color.green, textcolor=color.white, style=label.style_label_down, size=size.small) if buySignal
labelSell = label.new(x=time, y=labelPositionSell, text="SELL ❌", color=color.red, textcolor=color.white, style=label.style_label_up, size=size.small) if sellSignal

// Plot Support Level & Moving Averages
plot(supportLevel, color=color.blue, title="Support Level", linewidth=2)
plot(ema50, color=color.orange, title="50 EMA")
plot(ema200, color=color.red, title="200 EMA")

إخلاء المسؤولية