OPEN-SOURCE SCRIPT

EMA-RSI-MACD-Volume-Candle Combo HÂN HÂN

52
//version=5
indicator("EMA-RSI-MACD-Volume-Candle Combo", overlay=true)

// === EMA 20 & 50 ===
ema20 = ta.ema(close, 20)
ema50 = ta.ema(close, 50)
goldenCross = ta.crossover(ema20, ema50) // EMA20 cắt lên EMA50

plot(ema20, color=color.yellow, title="EMA 20")
plot(ema50, color=color.orange, title="EMA 50")

// === RSI (14) ===
rsi = ta.rsi(close, 14)
rsiCondition = rsi <= 30

// === MACD ===
macd = ta.ema(close, 12) - ta.ema(close, 26)
signal = ta.ema(macd, 9)
macdCondition = macd > 0

// === Volume breakout ===
volMA = ta.sma(volume, 20)
volCondition = volume > volMA * 1.5 // Volume > 150% so với MA20

// === Candlestick reversal patterns ===
// Bullish Engulfing
bullEngulf = close[1] < open[1] and close > open and close >= open[1] and open <= close[1]
// Hammer
hammer = (close > open) and ((high - low) > 3 * (open - close)) and ((close - low) / (0.001 + high - low) > 0.6)

candleCondition = bullEngulf or hammer

// === Combined Signal ===
buySignal = goldenCross and rsiCondition and macdCondition and volCondition and candleCondition

// Plot signals on chart
plotshape(buySignal, title="BUY Signal", style=shape.labelup, color=color.green, text="BUY", location=location.belowbar, size=size.large)

// Alerts
alertcondition(buySignal, title="BUY Signal Alert", message="EMA20>EMA50 + RSI≤30 + MACD>0 + Volume Breakout + Reversal Candle")

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

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.