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.
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.
Entry and exit rules
- 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)
- 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:
- A green line below price when the SuperTrend is bullish; a red line above price when bearish.
- Green triangle (BUY) below the candle when all three conditions align long.
- Red triangle (SELL) above the candle when all three conditions align short.
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.
//@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
- Trading this on choppy, range-bound stocks. The SuperTrend will flip back and forth rapidly, MACD will cross repeatedly, and the result is a stream of losing entries. Add a volatility or ADX filter before trading low-activity names.
- Ignoring the SuperTrend factor setting. A factor of 3 is appropriate for mid-volatility equities on the daily chart. On a 15-minute chart or a high-beta stock, consider raising it to 3.5–4.0 so the band doesn’t whipsaw during normal intraday noise.
- Expecting re-entries within the same trend. The position variable (
var pos) prevents re-entry while already long or short. You will only get a signal when the regime actually changes — not on every EMA wiggle. - Using this as a standalone system without any exit stop. The script holds indefinitely until the opposite signal fires. If a stock gaps against you overnight, there is no stop-loss logic. Use the SuperTrend line as a manual cut level.
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.