MACD settings: 8-21-5 versus 12-26-9, and what each number does
MACD settings explained: what fast, slow and signal lengths mean, how 8-21-5, 5-35-5 and 3-10-16 differ from 12-26-9, and how to change them in SuperCharting.
MACD settings are three numbers: the fast length, the slow length and the signal length. The default is 12-26-9. Traders who want quicker turns often try 8-21-5, and some use 5-35-5 or 3-10-16. No set is correct for every market. Each one only changes how fast the lines react and how many false crossings you accept. In SuperCharting you change all three from the indicator's Settings dialog, and the chart redraws as you type.
What the three numbers mean
MACD is built from two exponential moving averages of the close and a third average of their difference.
- Fast length (12): the EMA that follows price closely.
- Slow length (26): the EMA that follows price loosely.
- Signal length (9): an average of the MACD line, drawn as the signal line.
The MACD line is fast EMA minus slow EMA. The histogram is MACD minus the signal line, so it crosses zero at exactly the moment the two lines cross. The MACD indicator guide covers the parts and alerts. This page is about choosing the numbers.
An EMA with length n gives the newest bar a weight of 2 / (n + 1). For the fast EMA that is 15.4% at 12 and 22.2% at 8. For the slow EMA it is 7.4% at 26 and 9.1% at 21. A higher weight on the newest bar means the line turns sooner, and also gets pulled around by one odd bar.
Common MACD settings compared
| Set | Fast / slow / signal | What it tends to do |
|---|---|---|
| Default | 12 / 26 / 9 | The reference most traders and books use. Fewer crosses, later signals |
| Quicker | 8 / 21 / 5 | Turns sooner, crosses more often, more false crosses in ranges |
| Wide | 5 / 35 / 5 | Large gap between the averages, so bigger histogram swings and a line that stays above or below zero longer |
| Raschke 3-10-16 | 3 / 10 / 16 | Usually described with simple averages instead of EMAs; very fast and noisy on small timeframes |
A made-up example shows the effect. Say NSE:NIFTY sits at 24,000 for a long time and then closes at 24,100 and stays there. The histogram peaks four bars after the jump with 12-26-9 and three bars after with 8-21-5. With 5-35-5 it peaks after two bars and is about twice as tall (about 24 against 12), because the gap between the averages is wider. The MACD line itself keeps climbing for six to nine bars before it fades. This is arithmetic on a flat-then-step series, not market data, but it shows the trade-off: faster sets give earlier warning and more noise.
Past results do not guarantee future results, and a faster set is not "better" because it signals earlier.
How to change MACD settings in SuperCharting
- Open a chart, for example NSE:BANKNIFTY on the 15m interval.
- Click Indicators, type "macd" and click Moving average convergence divergence.
- Hover the legend line (it reads "MACD close 12 26 9") and click the gear for Settings.
- On Inputs, set Fast length to 8, Slow length to 21 and Signal length to 5.
- For 3-10-16, set 3, 10 and 16, then switch Oscillator MA type and Signal MA type from EMA to SMA.
- Click Ok. The legend text updates to the new numbers.
- To go back, open Settings again, click Defaults at the bottom and choose Reset settings.
Source can stay on Close, or you can pick another indicator's plot; see indicators on indicators. On the Visibility tab you can hide MACD on intervals where you do not want it.
To compare two sets side by side, save this short script from the Script Editor and add it from My scripts. It draws the 12-26-9 histogram as pale columns and the 8-21-5 histogram as a bold histogram over it:
//@version=6
indicator("MACD two settings", "MACD 2x")
srcIn = input.source(close, "Source")
fastA = input.int(12, "Set A fast", minval = 1)
slowA = input.int(26, "Set A slow", minval = 1)
sigA = input.int(9, "Set A signal", minval = 1)
fastB = input.int(8, "Set B fast", minval = 1)
slowB = input.int(21, "Set B slow", minval = 1)
sigB = input.int(5, "Set B signal", minval = 1)
[mA, sA, hA] = ta.macd(srcIn, fastA, slowA, sigA)
[mB, sB, hB] = ta.macd(srcIn, fastB, slowB, sigB)
plot(hA, "Histogram A", hA >= 0 ? color.new(color.teal, 60) : color.new(color.red, 60), style = plot.style_columns)
plot(hB, "Histogram B", hB >= 0 ? color.teal : color.red, style = plot.style_histogram, linewidth = 2)
hline(0, "Zero")
Which timeframe suits which set
The numbers count bars, not minutes. 12-26-9 on a 15m chart looks back about 6.5 hours of trading, and on a 1D chart about 26 sessions. So a "fast" set on 1D can still be slower than the default on 5m. Many traders keep one set across all timeframes so readings stay comparable, and others pick a quicker set only for 1m to 15m charts. Whichever you use, check it on the symbol you trade, for example XAUUSD 1h, over a long stretch of history, and use bar replay to see it develop bar by bar.
MACD in a range: histogram below zero, signal line above zero
A common question is what it means when the histogram is below zero while the signal line is still above zero. The histogram is MACD minus signal, so a negative histogram means the MACD line has dropped under its signal line. A signal line above zero means the smoothed MACD has been positive recently, so the fast EMA has been above the slow EMA. Put together: an up phase is cooling off, and momentum has slipped under its own average while the longer picture is still positive.
In a trending market that is often just a pullback. In a sideways market it happens again and again, because MACD wanders around zero and the signal line follows it a few bars late. In SuperCharting's four-colour histogram, a light-red bar below zero means the histogram is shrinking back towards zero, and a bright-red bar means it is growing more negative.
Ways traders read it in a range:
- Treat a histogram sign flip as noise unless the bars reach about the same height as earlier swings.
- Look at the zero line. If MACD keeps turning back at zero and never holds on one side, the market is ranging.
- Check price against the range edges. A flip near the top of a range means more than a flip in the middle.
These describe how the indicator behaves. They are not trade signals.
Frequently asked questions
What does MACD 8 21 5 mean?
It is a fast length of 8, a slow length of 21 and a signal length of 5. The MACD line is the 8-bar EMA minus the 21-bar EMA, and the signal line is a 5-bar EMA of that.
What are the best MACD settings for day trading?
There is no proven best set. Day traders commonly try 8-21-5 or 5-35-5 on 5m to 15m charts and 12-26-9 on higher ones. Test any set on your own symbol, with costs included, before relying on it.
Do alerts use the settings I changed?
An indicator alert runs the script with its default inputs. For crossovers on other numbers, save a script with your numbers as the defaults, as shown in the MACD indicator guide.
Can I change the MACD settings for every chart at once?
Settings belong to each indicator on each chart. Add the indicator once with your numbers, then save it in an indicator template to reuse the set.