MadStocks Learn Indicator Library Trend SuperTrend + MACD + EMA
🌿 TREND

SuperTrend + MACD + EMA Strategy

A triple-confirmation entry system that requires three independent tools to agree before signaling a trade. No single indicator can generate a buy or sell alone — all three must align.

⚡ 30-second answer

Long when EMA 9 > EMA 18 and MACD line > Signal line and close > SuperTrend (green band). Short when all three flip bearish simultaneously. The system holds a position until the opposite signal fires — there is no partial exit rule.

Why three indicators?

Each indicator catches a different type of market information. Using all three together eliminates most false signals that would appear if any single one were traded alone.

EMA 9 / 18
Short-term bias filter. When the fast EMA (9) is above the slow EMA (18), short-term momentum is bullish. Reverses quickly in choppy markets — which is why it needs MACD and SuperTrend to confirm.
MACD 12/26/9
Momentum confirmation. When the MACD line is above its signal line, upward momentum is accelerating. Filters out EMA crossovers that happen in low-energy, sideways tape.
SuperTrend (3, 10)
Trend direction gate. The SuperTrend band flips from green (support) to red (resistance) using ATR. It keeps the system out of counter-trend entries even when EMA and MACD momentarily align against the larger trend.

Entry and exit rules

▲ BUY signal — all three must be true
  • EMA 9 is above EMA 18 (short-term bullish bias)
  • MACD line is above the signal line (momentum rising)
  • Close price is above the SuperTrend band (trend is green)
  • Position was flat or short on the previous bar (no double-entry)
▼ SELL signal — all three must be true
  • EMA 9 is below EMA 18 (short-term bearish bias)
  • MACD line is below the signal line (momentum falling)
  • Close price is below the SuperTrend band (trend is red)
  • Position was flat or long on the previous bar (no double-entry)

Exits are signal-driven — the system stays in a long until a short signal fires, and vice versa. There is no time-based stop. If you want an explicit stop-loss, use the SuperTrend band itself as a dynamic exit level.

Indicator settings at a glance

Indicator Parameter Default Why this value
EMA (fast) Period 9 Captures roughly two trading weeks — reactive enough to catch short swings without whipsawing in noise.
EMA (slow) Period 18 Exactly 2× the fast EMA, ensuring clean crossovers with minimal lag mismatch.
MACD Fast / Slow / Signal 12 / 26 / 9 The standard TradingView default. Works across most liquid equities without per-symbol tuning.
SuperTrend ATR Period 10 Shorter ATR lookback makes the band responsive to recent volatility expansion.
SuperTrend Factor (multiplier) 3.0 Standard factor; increase to 3.5–4.0 on high-beta stocks to reduce false flips.

What the chart looks like

On a standard chart you will see:

The EMA and MACD lines are not plotted on the price chart in the default script — they operate as internal filters. Add them as separate panels if you want to see the raw crossover timing.

When does this system work best?

The strategy performs well in trending markets with clean directional moves. It struggles in low-ADX, sideways tape where all three indicators can briefly mis-align and then snap back, generating a signal that never develops into a real move.

Tip: Run an ADX filter alongside this system. If ADX is below 20, treat any signal as low-confidence and reduce position size or skip entirely.

The Pine Script

Copy this directly into TradingView Pine Editor (Pine Script v5). The script adds BUY/SELL labels to the chart and is ready to use on any timeframe.

PINE SCRIPT v5 — TradingView
//@version=5
indicator('Madstocks SuperTrend + MACD + EMA', overlay=true)

//EMA
fast_ema = ta.ema(close, 9)
slow_ema = ta.ema(close, 18)

//MACD
fastInput = 12
slowInput = 26
[macdLine, signalLine, histLine] = ta.macd(close, fastInput, slowInput, 9)

//Supertrend
atrPeriod = 10
factor = 3
[supertrend, direction] = ta.supertrend(factor, atrPeriod)

linecolor = direction < 0 ? #00ff00 : #ff0000
plot(supertrend, color=linecolor, linewidth=2, title='Supertrend')

//Condition
longentry = fast_ema > slow_ema and macdLine > signalLine and close > supertrend
shortentry = fast_ema < slow_ema and macdLine < signalLine and close < supertrend

var pos = 0

if longentry and pos <= 0
    pos := 1

if shortentry and pos >= 0
    pos := -1

longsignal  = pos ==  1 and (pos !=  1)[1]
shortsignal = pos == -1 and (pos != -1)[1]

plotshape(longsignal,  style=shape.triangleup,   color=#00FF00, text='BUY',
         textcolor=#FFFFFF, editable=false, location=location.belowbar, size=size.small)
plotshape(shortsignal, style=shape.triangledown, color=#FF0000, text='SELL',
         textcolor=#FFFFFF, editable=false, location=location.abovebar, size=size.small)

Common mistakes

See the trend tools live on MadStocks

Use the MadStocks screener and chart to filter stocks by trend alignment and spot setups in real time.

Open Screener → Back to Trend Indicators →