How is the MACD indicator constructed, and what do its three parts mean?
Moving Average Convergence Divergence refers to the convergence and divergence of moving averages. The display usually contains two lines and histogram bars around zero. All three elements come from one calculation chain.
- The MACD line. The slow exponential moving average is subtracted from the fast one. In the standard setting, this is the 12-period EMA minus the 26-period EMA.
- The signal line. It is calculated as a 9-period EMA of the MACD line. It moves more smoothly and serves as the reference for crossovers.
- Histogram. The signal line is subtracted from the MACD line. Positive bars mean the MACD line is above the signal line; negative bars mean it is below.
Consider a simple educational example. The fast EMA is 105 and the slow EMA is 101, so the MACD line equals 4. If the signal line is at 3, the histogram equals 1. This is not a price forecast for the next candle. The number simply shows the current distance between the smoothed values.
Gerald Appel created the MACD indicator in the 1970s, and Thomas Asprey added the histogram in 1986. The formula is now built into TradingView, MetaTrader, and most trading platforms.
If it is not yet clear why charts use different groups of tools, start with the guide to trading indicator categories. MACD belongs to the trend and momentum group.
What does the position of the lines relative to zero mean?
When the MACD line is above zero, the short-period moving average is above the long-period one, so recent momentum is tilted upward. Below zero, the relationship is reversed. Crossing zero means the two averages have become equal and changed order.
In practice, MACD is useful as a context filter. A bullish MACD-line crossover above zero confirms an existing rise but arrives late. The same crossover far below zero may be an early sign of recovery even though price remains in a weak regime.
Do not confuse zero with support or fair value. It exists only within the calculation. On another timeframe or with different periods, the lines will be positioned differently even though the asset's candles are unchanged.
MACD is not bounded between 0 and 100, so it is not read as a conventional overbought scale. RSI is more often used for that task; the differences are explained in RSI versus the Midas signal set.
How do you read a line crossover without entering automatically?
When the MACD line rises above the signal line, momentum is strengthening relative to its own smoothed value. A move below indicates weakening momentum. Platforms often color these events green and red, making them easy to mistake for ready-made commands.
The problem is that both lines depend on past prices. By the time a crossover forms, part of the move has already occurred. In a strong trend, this lag can be a useful filter because it removes random noise. In a narrow range, the same lag creates whipsaws as the lines cross several times without follow-through.
If the MACD indicator shows a crossover, check four points before you decide:
- the MACD line is on the expected side of zero rather than simply oscillating around it;
- the higher timeframe has a clear direction;
- price has not run into the nearest level;
- the stop placement and acceptable loss are defined before entry.
This turns a crossover into a reason to open the chart, not an instruction to enter a trade. The same sequence is useful when reading moving averages: context first, entry point second.
What does the histogram notice before the crossover?
The histogram grows when the MACD line moves away from the signal line. Its bars shrink as the lines converge, and it reaches zero when they cross.
Imagine a series of positive bars: 4, 6, 7, 5, 2. Momentum remains positive but is weakening, while price may continue rising through inertia. Selling after the first shorter bar can mean exiting long before an actual reversal.
MACD is useful here for observing the rate of change. The histogram answers 'Is the move accelerating or losing momentum?' It does not answer 'Where should I buy or sell?' Levels, candle structure, and higher-timeframe context remain separate layers.
For practice, first hide the lines and watch only the bars. Then restore both lines and check which contractions actually ended in a crossover. This quickly shows how many early warnings do not become reversals.
Why are settings 12, 26, and 9 not the law of the market?
Standard MACD uses 12 and 26 as the lengths of the fast and slow EMAs. Nine sets the smoothing period for the signal line. TradingView and MQL5 use this combination by default, making it convenient for learning and comparing charts.
The effect of each change is predictable:
| Change | What happens | Trade-off |
|---|---|---|
| Decrease the fast and slow periods | lines become more responsive | more early and false crossovers |
| Increase the periods | lines become smoother | The signal will appear later. |
| Decrease the signal-line period | crossovers become more frequent | the histogram becomes noisier |
| Increase the signal-line period | The noise will decrease. | The slowdown will be noticeable later. |
The same set of periods represents different spans of time. Twenty-six five-minute candles cover 130 minutes, while twenty-six daily candles cover roughly one month of trading days. That is why the phrase 'best MACD settings' is incomplete without an asset and timeframe.
Start with the standard settings, then compare a nearby combination such as 10/24/8 or 14/30/10. If a small adjustment completely changes the conclusion, the settings are overfit to one historical section. Chasing perfect numbers does not replace robustness testing.
How can you test MACD on your chart in 15 minutes?
The first test does not require a complex testing tool. It requires an honest process in which future candles remain hidden.
- Open the chart for the asset and timeframe on which you actually make decisions.
- Add standard MACD with 12/26/9 settings and scroll the chart back several months.
- Go left to right. On each crossover, write down the position relative to zero and market condition: trend or a range-bound market.
- Record whether follow-through lasted at least several candles and where an unambiguous stop loss could have been placed.
- Count signals within a trend separately from signals near zero. Do not combine them into a single result.
- Shift the periods by a few steps and repeat the review on a short section.
Mini-table for notes:
| Date | Crossover | Where relative to zero | Market regime | What happened next |
|---|---|---|---|---|
| 12.03 | Up | Below zero | Range | Return after two candles |
| 28.03 | Up | Above zero | trend | Momentum continued |
Two rows prove nothing; they only illustrate the record format. Keep one MACD setting across the entire sample. This reveals where the signal acts as confirmation and where it creates a convincing story in hindsight. The general instrument-selection process is described in the guide to an indicator set.
Can divergence warn of a reversal?
Bearish divergence occurs when price makes a new high but the MACD peak is lower than the previous one. Bullish divergence occurs when price makes a new low while the indicator forms a higher low. In both cases, MACD shows that price is continuing to move with weaker underlying momentum.
TradingView and MQL5 also describe hidden divergences, which traders more often look for in the direction of the trend. Beginners are better served by following one consistent sequence:
- First identify two comparable highs or lows in price.
- Then identify divergence on the MACD line, not a random bend in the histogram.
- Then confirmation: crossover, breakout of a level, or a change in candle structure.
Price may make several more highs after the first divergence. Entering early against a strong trend is often more costly than entering late. Therefore, divergence serves as a warning of weakness, not a reversal timer.
Midas Up compares divergences across 11 oscillators, including MACD. This does not make the signal infallible, but it removes the need to switch manually from one indicator to another.
Why does MACD fail in a range-bound market?
Imagine a horizontal range. Price moves between its upper and lower boundaries while the moving averages remain close together. The fast EMA crosses above the slow one after a few strong candles, then crosses back below after a similar pullback. MACD oscillates around zero and the histogram changes color, but the market remains in the range.
TradingView describes frequent directional shifts near zero as a neutral regime. No single 'magic' setting can fix this. Shorter periods increase the number of crossovers, while longer periods merely show them later.
Signs of a section best skipped:
- the MACD line crosses zero repeatedly within a short span;
- the histogram bars are small and repeatedly change sign;
- the moving averages on the price chart are intertwined;
- the nearest horizontal boundaries remain unbroken.
If the market has not selected a direction, a trend indicator should not invent one. It is usually better to wait for a breakout from the range and a retest of the level. The behavior of moving averages in this regime is covered in the guide to moving averages.
How does Midas differ from a single MACD pane?
A standard MACD displays one pair of moving averages and its smoothing. To assess trend, overextension, divergence, and levels, a trader must add other panes and combine the readings independently.
Midas uses MACD as one input within a broader system:
- when assessing overextension, Midas Down evaluates six oscillators, including MACD;
- Midas Up checks divergences across 11 oscillators, including MACD;
- the Price Momentum block shows the direction and quality of the wave instead of requiring several separate panes;
- trend-following EMAs and levels provide context for the signal.
This reduces manual switching, but responsibility does not transfer to the indicator. The signal arrives after the candle closes and means 'look at the chart.' There is no automatic trade or guarantee of an outcome.
When is MACD better left out?
No indicator mode can replace discipline. Several situations are particularly hazardous:
- Open candle. The lines and histogram change with price. A crossover may disappear before the candle closes.
- Sudden news event. Historical moving averages are unaware of a regulator's decision or a company's report.
- Narrow range. Near zero, MACD becomes a generator of frequent crossovers.
- Entering directly into a level. Momentum is present, but there is insufficient room before resistance.
- No risk plan. Even sound market context does not determine position size or the acceptable loss.
FINRA notes that investments involve several types of risk, including market risk and liquidity risk. An indicator eliminates neither; it only structures price observation.
Important. This material is informational and is not personalized investment advice. Markets are volatile, trading involves the risk of capital loss, and past results do not guarantee future performance.
Sources
- TradingView Help Center, "Moving Average Convergence Divergence (MACD)" - https://www.tradingview.com/support/solutions/43000502344-moving-average-convergence-divergence-macd-indicator/
- TradingView Help Center, "MACD Strategy" - https://www.tradingview.com/support/solutions/43000644943-macd-strategy/
- MQL5 Reference, "iMACD" - https://www.mql5.com/en/docs/indicators/imacd
- MQL5 Standard Library, "Signal of the MACD Oscillator" - https://www.mql5.com/en/docs/standardlibrary/expertclasses/csignal/signal_macd
- Chong T., Ng W., "Technical Analysis and the London Stock Exchange," JRFM - https://doi.org/10.3390/JRFM7010001
- Chong T., Ng W., "A Comparison of MACD and RSI," JRFM - https://doi.org/10.3390/JRFM14010037
- FINRA, "Understanding Investment Risk" - https://www.finra.org/investors/investing/investing-basics/risk
Frequently asked questions
What is the difference between MACD and RSI?
MACD compares two moving averages and shows trend momentum without fixed boundaries. RSI measures the rate of change on a 0-100 scale. In a strong trend, both tools can produce unusual readings for an extended period, so read them within market context.
Which timeframes does MACD work on?
The formula works on any timeframe, but its periods cover different amounts of real time. The 12/26/9 setting on M5 describes hours, while on D1 it describes weeks. You must test it on your own trading horizon. The same setting on different charts therefore does not represent the same logic: on minute charts it reacts to intraday noise, while on daily charts it reacts to multiweek waves.
What do the numbers 12, 26, and 9 mean?
Twelve and twenty-six are the periods of the fast and slow EMAs. Nine is the period of the EMA that smooths the MACD line to form the signal line. The fast EMA responds to recent prices, the slow EMA smooths price history, and the MACD line shows the difference between them. The signal line provides a reference for observing acceleration and deceleration in that difference.
Why does the histogram change before the lines cross?
Histogram bars show the distance between the MACD and signal lines. As the distance shrinks, the bars become smaller; a crossover occurs only when it reaches zero. The histogram therefore changes first because it measures the difference itself. Shrinking bars indicate deceleration, but deceleration does not have to end in a crossover.
Is MACD a leading or lagging indicator?
MACD lags because it is built from averages of past prices. The histogram can show a slowdown in that difference earlier, but it does not predict an inevitable reversal. MACD describes a move already underway better than it predicts a new one, so use it to confirm a scenario rather than as an entry command.
Is it possible to trade using MACD alone?
It is not advisable. A complete decision needs at least the market regime, a level, a scenario invalidation point, and a risk limit. Standalone crossovers are especially unreliable in a range-bound market. MACD describes momentum but does not show where price reacted before or how much you can afford to lose. Without a level and predefined invalidation, crossovers become a series of random entries.
How do I add MACD to TradingView?
Open the 'Indicators' menu, find Moving Average Convergence Divergence, and add the built-in version. In the settings, check the price source, the 12/26/9 periods, and calculation after candle close. The display continues to change while a candle is forming, so make decisions from closed candles. Save the settings as a template so you do not have to re-enter the periods on every chart.








Comments
Source comments are not translated and are never replaced with Russian text.