OPEN-SOURCE SCRIPT
EMA-RSI-MACD-Volume-Candle Combo HÂN HÂN

//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")
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")
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.