⚡ Indicador Combo

Indicador Combo SuperTrend + MACD — Pine Script Listo

Por Dan Machado · Abril 2026 · 8 min

SuperTrend es uno de los mejores indicadores de tendencia. MACD es uno de los mejores indicadores de momentum. ¿Juntos? Un combo poderoso que filtra señales falsas e identifica entradas de alta probabilidad.

En este post te paso el código Pine Script v5 completo que combina ambos en un solo indicador, con señales visuales y alertas.

Cómo funciona el combo

  • SuperTrend define la dirección de la tendencia (verde = alza, rojo = baja)
  • MACD confirma el momentum (histograma positivo o negativo)
  • Señal de COMPRA: SuperTrend cambió a verde Y histograma MACD > 0
  • Señal de VENTA: SuperTrend cambió a rojo Y histograma MACD < 0

💡 ¿Por qué combinar?

SuperTrend solo da muchas señales falsas en mercados laterales. MACD solo se queda atrás en tendencias fuertes. Combinados, uno filtra los errores del otro. Resultado: menos trades, pero de mayor calidad.

Código completo

Pine Script v5📋 Copiar
//@version=5
indicator("SuperTrend + MACD Combo — IA Trader Pro", overlay=true)

// === PARAMETERS ===
atrPeriod = input.int(10, "ATR Period SuperTrend")
factor = input.float(3.0, "SuperTrend Multiplier", step=0.1)
fastLen = input.int(12, "MACD Fast")
slowLen = input.int(26, "MACD Slow")
sigLen = input.int(9, "MACD Signal")

// === SUPERTREND ===
[supertrend, direction] = ta.supertrend(factor, atrPeriod)

// === MACD ===
[macdLine, signalLine, hist] = ta.macd(close, fastLen, slowLen, sigLen)

// === SIGNALS ===
stBuy = direction < 0 and direction[1] >= 0
stSell = direction > 0 and direction[1] <= 0

comboBuy = stBuy and hist > 0
comboSell = stSell and hist < 0

// === PLOTS ===
upTrend = direction < 0 ? supertrend : na
dnTrend = direction > 0 ? supertrend : na

plot(upTrend, "ST Up", color=#00E676, linewidth=3, style=plot.style_linebr)
plot(dnTrend, "ST Down", color=#FF5252, linewidth=3, style=plot.style_linebr)

// Background
bgcolor(direction < 0 ? color.new(#00E676, 92) : color.new(#FF5252, 92))

// Combo signals
plotshape(comboBuy, "COMBO BUY", shape.labelup, location.belowbar, color.new(#00E676, 0), text="🚀 BUY", textcolor=color.white, size=size.normal)
plotshape(comboSell, "COMBO SELL", shape.labeldown, location.abovebar, color.new(#FF5252, 0), text="📉 SELL", textcolor=color.white, size=size.normal)

// SuperTrend-only signals (gray)
plotshape(stBuy and not comboBuy, "ST Up", shape.triangleup, location.belowbar, color.new(color.gray, 60), size=size.tiny)
plotshape(stSell and not comboSell, "ST Down", shape.triangledown, location.abovebar, color.new(color.gray, 60), size=size.tiny)

// Dashboard in top-right
var table dash = table.new(position.top_right, 2, 4, bgcolor=color.new(#06090F, 20), border_width=1, border_color=color.new(color.gray, 80))
if barstate.islast
    table.cell(dash, 0, 0, "Indicator", text_color=color.gray, text_size=size.tiny)
    table.cell(dash, 1, 0, "Status", text_color=color.gray, text_size=size.tiny)
    table.cell(dash, 0, 1, "SuperTrend", text_color=color.white, text_size=size.small)
    table.cell(dash, 1, 1, direction < 0 ? "UP ▲" : "DOWN ▼", text_color=direction < 0 ? #00E676 : #FF5252, text_size=size.small)
    table.cell(dash, 0, 2, "MACD Hist", text_color=color.white, text_size=size.small)
    table.cell(dash, 1, 2, str.tostring(hist, "#.####"), text_color=hist > 0 ? #00E676 : #FF5252, text_size=size.small)
    table.cell(dash, 0, 3, "Signal", text_color=color.white, text_size=size.small)
    table.cell(dash, 1, 3, (direction < 0 and hist > 0) ? "🚀 BUY" : (direction > 0 and hist < 0) ? "📉 SELL" : "⏸ WAIT", text_color=color.white, text_size=size.small)

// === ALERTS ===
alertcondition(comboBuy, "Combo BUY", "SuperTrend + MACD: BUY signal confirmed")
alertcondition(comboSell, "Combo SELL", "SuperTrend + MACD: SELL signal confirmed")

Cómo usarlo

  • Timeframes recomendados: H1 o H4 (funciona mejor en tendencias de medio plazo)
  • Activos: Forex majors, índices sintéticos (V75), crypto
  • Espera la señal «COMBO» (con etiqueta 🚀 BUY o 📉 SELL) — ignora las flechas grises
  • Configura alertas para recibir notificaciones cuando el combo se dispare
  • Combina con stop loss de 2x ATR y take profit de 4x ATR (riesgo-recompensa 1:2)

✅ Mejores resultados

Este combo funciona mejor en mercados con tendencia clara. En mercados laterales, las señales se vuelven raras (lo cual es bueno — te protege de malos trades).

🚀 Usa este combo y aplícalo en Deriv (cuenta demo gratis):

Abrir Cuenta Demo Deriv →
DM

Dan Machado

Más en Indicadores y Scripts.

⚠️ Indicador educativo. El trading implica riesgo. Aviso Legal.