全職奶爸

MACD Indicator: Settings, Histogram and TradingView Guide

MACD indicator settings guide

The MACD indicator compares a faster moving average with a slower one, then compares that difference with a signal line. The first comparison produces the MACD line. The second produces the histogram. Keeping those two comparisons separate makes the chart much easier to read. For choosing MACD alongside other tools, the TradingView indicators guide compares indicator roles, script access and signal-confirmation settings.

A histogram can be positive while the MACD line is below zero. That is a valid combination, not a broken indicator. It can describe a recovery in a still-negative moving-average relationship. Treating every green bar as an instruction to buy hides that distinction.

This guide uses TradingView's built-in MACD, real settings screens and an NQ five-minute chart. The numerical examples are hypothetical calculations. They show what each series means without attaching an invented win rate to a crossover or a favorite parameter combination.

What MACD means on a chart

MACD stands for Moving Average Convergence Divergence. Gerald Appel developed it in the 1970s. The name describes moving averages approaching one another and moving apart. In its familiar default form, the indicator uses exponential moving averages of closing prices.

The MACD line is the faster average minus the slower average. The signal line smooths the MACD line itself. The histogram displays the signed distance between those two indicator lines. All three are derived from the same price series; the bars do not add a separate measurement of trading volume.

The Momentum (MOM) guide compares a direct endpoint price difference with moving-average-based MACD, using a worked example that separates the latest candle direction from the oscillator reading.

The zero line provides a reference for both comparisons, but the meanings differ. MACD above zero means the fast price average is above the slow price average. A histogram above zero means MACD is above its signal line. Neither statement, by itself, tells you where a trade would become invalid.

Unlike RSI, MACD has no fixed 0–100 scale or universal 70/30 boundaries. Its numerical size depends on the price series, timeframe and settings. A reading of 20 on a high-priced index future cannot be ranked against 2 on an unrelated stock simply by comparing those numbers.

The same caution applies to an apparent extreme on one chart. A large distance between averages describes that calculation's current state. It does not create a price level at which the market must reverse, and it does not measure how much account risk a trader can afford.

MACD formula and the meaning of 12, 26 and 9

For TradingView's default EMA configuration, MACD = EMA of Close over 12 bars − EMA of Close over 26 bars. The signal line is a 9-bar EMA of MACD, and Histogram = MACD − Signal.

The 9 refers to smoothing the MACD series. It is not a third price average subtracted from the first two, and it does not define a nine-bar holding period. Changing the signal length changes the reference against which the histogram is measured.

The lengths refer to calculation bars. On a five-minute calculation, the fast and slow averages update from five-minute observations. On a daily calculation, they update from daily observations. Because an EMA is recursive, those lengths also do not create a hard cutoff that discards all influence from earlier prices.

MACD has two different comparisonsDefault EMA calculation diagram. MACD is EMA12 minus EMA26 ofClose. Signal is EMA9 ofMACD. Histogram is MACD minusSignal. Hypotheticalgiven values Fast99 Slow101 give MACDminus2;Signalminus3 gives positiveHistogram1 despite negativeMACD.MACD has two different comparisonsDEFAULT EMA FORMULAS · The numbers below are a hypothetical state.1. TWO PRICE AVERAGESFast = EMA(Close, 12)Slow = EMA(Close, 26)2. MACD LINEFast − SlowAbove 0 → Fast > Slow3. SIGNAL LINEEMA(MACD, 9)Smooths MACD, not price directly4. HISTOGRAMMACD − SignalAbove 0 → MACD > SignalExample: Fast 99 − Slow 101 = MACD −2Histogram: −2 − (−3) = +1, even while MACD is below zero.

The usual EMA update is new EMA = previous EMA + α × (new price − previous EMA), where α = 2 / (length + 1). Length 12 therefore uses 2/13, while length 26 uses 2/27. The shorter average gives the latest observation more weight.

Initialization still matters. Platforms need a starting value and sufficient history before recursive calculations can be compared sensibly. Matching only the last two closes does not establish that two platforms should have identical EMAs. Use the same input history, initialization convention and completed timestamps when reproducing a series.

A worked update from price to histogram

Assume an established calculation has a previous fast EMA of 101, a previous slow EMA of 99, and a previous signal value of 1. These are explicitly given starting states for this example, not averages inferred from two prices. The previous MACD is 101 − 99 = 2.

Now let the next closing price be 102. The new fast EMA is 101 + (2/13) × (102 − 101) = 101.153846. The new slow EMA is 99 + (2/27) × (102 − 99) = 99.222222. Their difference is approximately 1.931624.

The signal EMA uses a smoothing factor of 2/(9 + 1), or 0.2. Its new value is 1 + 0.2 × (1.931624 − 1) = 1.186325. Subtracting that signal from MACD gives a histogram of approximately 0.745299.

Both the price averages increased, yet MACD decreased from 2 to about 1.931624. The slower EMA had farther to move toward the new close. This is why “price went up, so MACD must go up” is an unreliable shortcut. The calculation depends on the previous average states as well as the newest price.

The histogram remains positive because MACD is still above its signal. That positive bar does not mean MACD itself increased on this update. A histogram's sign describes the relationship between two indicator values; its change from the previous bar is another observation.

Four combinations of MACD and histogram signs

Read the MACD line's location first, then inspect its relationship with the signal line. The following invented values show all four sign combinations. They are arithmetic states, not entry recommendations.

MACDSignalHistogramWhat the values establish
+2+1+1Fast price MA is above slow MA; MACD is above its signal.
+2+3−1Fast price MA is above slow MA; MACD is below its signal.
−2−3+1Fast price MA is below slow MA; MACD is above its signal.
−2−1−1Fast price MA is below slow MA; MACD is below its signal.

The third row is especially useful when studying a rebound. The faster price average remains below the slower one, but MACD is higher than its smoothed signal. That positive MACD-versus-signal relationship describes the current oscillator state; a crossover also requires a change from the preceding state. Calling the whole price trend bullish would require more evidence.

The second row shows the corresponding situation above zero. MACD remains positive while the histogram turns negative. It can occur during a pullback inside an upward price sequence. A negative bar alone does not establish that the sequence of higher price swings has ended.

A complete reading can also include slopes: is MACD rising or falling, is the signal rising or falling, and is their signed distance widening or narrowing? Keep those statements explicit. The words positive, rising and bullish are often used casually, but they do not describe exactly the same mathematical condition.

Add the built-in MACD on TradingView

Open the intended symbol and set the chart interval. Select Indicators, metrics, and strategies, search for MACD, and choose Moving average convergence divergence under Technicals. The separate MACD strategy result is a strategy script. Community indicators may add their own filters, colors and alerts.

The standard indicator appears below the price chart. Double-click its MACD label to open settings. In Inputs, verify Source Close, Fast length 12, Slow length 26, Signal length 9, Oscillator MA type EMA, and Signal MA type EMA.

Real TradingView MACD Inputs showing Close, lengths 12 26 9, EMA for both moving average types, Chart timeframe and Wait for timeframe closes checked
Match both MA type fields as well as the three lengths.

For an indicator calculated on the visible candles, keep Timeframe at Chart. Confirm the exact symbol, exchange, contract and session before comparing the output with another person's chart. An index, a continuous futures series and a broker's CFD are different inputs even when their names refer to the same underlying market.

Open Style to identify Histogram, MACD, Signal line and Zero. These labels are more reliable than memorizing blue, orange, red or green. The colors can be customized, and another platform may use different defaults.

Real TradingView MACD Style settings showing four histogram color controls and separate MACD, Signal line and Zero options
The histogram has four color controls. Line names and the zero reference remain the basis for interpretation.

Keep all three series visible while learning the relationships. Hiding a line can simplify a familiar setup, but it can also make it harder to tell which comparison produced a particular bar. Save the layout once the symbol, interval and indicator inputs match the study you intend to repeat.

Histogram colors, longer bars and shorter bars

A positive histogram means MACD is above its signal; a negative histogram means MACD is below its signal. Increasing distance from zero means those lines are farther apart. Movement toward zero means the distance is shrinking.

TradingView's default histogram uses two shades on each side of zero to distinguish changes from the preceding value. The stronger teal and lighter teal belong to positive bars, while the two red shades belong to negative bars. Read the sign and the direction of change before attaching a trading interpretation to the shade.

Imagine histogram values of +4, +3 and +1. The bars are positive but shortening. MACD is still above its signal, although the positive separation has decreased. The next value could become negative, remain near zero, or expand positively again. The sequence alone does not decide which outcome will occur.

Now consider −4, −3 and −1. These negative bars are also shortening in absolute size. MACD remains below its signal, but the negative separation is becoming smaller. Describing that as a recovery in the relationship is more precise than saying the market has already become bullish.

The histogram is a difference series, not a count of buyers and sellers. Longer bars do not directly measure aggressive order flow or the number of contracts traded. If volume is part of the setup, inspect volume data separately instead of reading it into the oscillator's columns.

Read the real NQ five-minute example

The following real chart uses NQ, five-minute candles, Close, and the default 12/26/9 EMA configuration. MACD is the blue line, the signal is orange, and the histogram plots their signed difference. These colors identify this screenshot's settings.

Real NQ five-minute TradingView chart with MACD Close 12 26 9, blue MACD, orange signal and positive and negative histogram bars
Read price, the lines' zero-axis location and their separation as distinct observations.

In the right-hand part of the image, price has pulled back from its later high. Near the far right, MACD is below the signal and both lines are below zero. The negative histogram therefore describes a different condition from an earlier positive histogram during the upward portion of the session.

Several earlier stretches show bars contracting toward zero before the lines cross. Those changes can draw attention to cooling separation. They do not establish that a reversal trade would have filled or made money. A screenshot contains no complete order history, transaction costs or account-level outcome.

The latest candle was still developing when the image was captured. Its close and the corresponding indicator values could change. For a candle-close rule, evaluate the completed reading at the decision time, rather than treating an unfinished crossover as a final event.

Signal-line crossovers and zero-line crossovers

A bullish signal-line crossover occurs when MACD moves from below its signal to above it. A bearish crossover moves the other way. Because the histogram equals MACD minus Signal, the lines' equality corresponds to a histogram value of zero. Their crossover and the histogram's sign transition describe the same underlying relationship.

A MACD zero-line crossover is different. It occurs when the fast price average crosses the slow price average. That event changes the sign of the MACD line, not merely the sign of the histogram. It can happen at a different time from the signal-line crossover.

For a defined study, specify whether equality is allowed at the previous observation and whether the current value must be strictly above or below. An indicator touching a level and an indicator crossing through it are different events. Apply the same condition to the historical test and the live decision.

Price context changes the meaning of the setup. A bullish signal crossover below zero may be a rebound within a larger decline. A bearish crossover above zero may be a pullback within a rising sequence. Mark the relevant price swings before deciding which event the strategy is intended to trade.

Ranges can produce repeated crossings as the lines stay close together. Taking every crossing creates repeated opportunities for losses, costs and missed fills. Adding a filter also changes which trades qualify, so measure its contribution rather than assuming that more conditions automatically improve results.

MACD divergence and confirmation timing

Regular bullish divergence pairs a lower price low with a higher MACD low. Regular bearish divergence pairs a higher price high with a lower MACD high. Compare corresponding price swings and state whether the oscillator comparison uses the MACD line or the histogram.

They are separate series. A line divergence and a histogram divergence can occur at different times. A drawing labeled only “MACD divergence” leaves an important part of the rule unresolved if readers cannot tell which series supplied the two pivots.

Hidden bullish divergence pairs a higher price low with a lower oscillator low; hidden bearish divergence pairs a lower price high with a higher oscillator high. These are often studied in a continuation context. Keep them distinct from the regular pattern rather than labeling every disagreement a reversal signal.

Divergence: name the oscillator series you compareFour hypothetical panels show corresponding price andMACDlinepivots. RegularbullpriceLL/MACDHL,regularbearpriceHH/MACDLH,hiddenbullpriceHL/MACDLL,hiddenbearpriceLH/MACDHH. Histogramdivergence is a separate comparison;laterconfirmationcanbacklabel.Divergence: name the oscillator series you compareHYPOTHETICAL · MACD LINE PIVOTS · No entry or performance is implied.Regular bullishPrice: lower lowMACD: higher lowRegular bearishPrice: higher highMACD: lower highHidden bullishPrice: higher lowMACD: lower lowHidden bearishPrice: lower highMACD: higher highHistogram pivots are a different series. Record actual confirmation time.

A divergence can persist while price continues in its earlier direction. The useful next question is what price event would confirm the particular setup: a defined swing break, a reclaim, or another explicit condition. Choose that event before inspecting the eventual outcome.

Automated pivots can also require later bars to confirm. A label drawn back on a swing candle does not prove the label existed on that candle in real time. Preserve the actual confirmation timestamp in any replay or trading record, and include examples where a promising disagreement failed to produce a reversal.

Why the same 12/26/9 can differ between platforms

Match the formulas as well as the lengths. TradingView's built-in default uses an EMA signal line. MetaTrader 5's documented built-in MACD calculation uses a 9-period SMA of MACD for its signal line. An EMA and an SMA of the same length need not have the same value or crossing time.

In TradingView, Oscillator MA type controls the fast and slow price averages, while Signal MA type controls the average applied to the MACD line. Changing the signal type to SMA changes that reference series. It does not by itself verify every other setting or display convention on another platform.

Platform terminology can add confusion. A pane may draw the MACD series itself as bars, while another uses bars for MACD minus Signal. Read the platform's series definition before comparing histogram heights. Equal colors or a shared MACD label do not establish equal calculations.

Next match source price, symbol, session, contract adjustment, timeframe and available history. Compare completed values at the same timestamp. A historical adjustment or a developing candle can create differences even when the formula names match.

For a higher calculation timeframe, record Wait for timeframe closes. With waiting enabled, final values become available after the selected higher-timeframe bar closes. With waiting disabled, a developing value can change during that bar. Timeframe Chart still allows the current chart candle's price and MACD to move before it closes.

Settings, other indicators and a trading record

Use 12/26/9 as a reproducible baseline, then compare alternatives on the same data and rules. Shorter lengths react differently to recent changes and can create more frequent transitions. A faster-looking crossover is not evidence of a better strategy after costs.

For one-minute, five-minute or intraday studies, specify the session, entry rule, order type, invalidation and exit before optimizing parameters. A setting chosen from the best-looking historical screenshot has not been evaluated across the losses and unfilled orders that occur in practice.

The RSI indicator measures a gain-to-loss balance on a bounded scale, while MACD compares averages in price units. They can disagree without either being broken. Both are price-derived, so agreement does not automatically provide two independent pieces of evidence.

Market structure and SMC concepts describe price swings, levels and sequences. VWAP supplies a volume-weighted price reference, and Volume Profile distributes activity by price. Give each tool a specific role instead of adding confirmations until every historical trade looks obvious.

Position size follows the chosen price invalidation and the account's risk capacity. MACD approaching a crossover does not suspend a daily loss limit or reduce the cost of a wider stop. Decide the amount of planned risk independently of how attractive the oscillator looks.

Keep a trading journal with the exact MA types, lengths, timeframes, session and confirmation time. Save the chart before the outcome. Evaluate a separate sample after choosing parameters, and include costs, drawdown and outcome distribution alongside any win rate. This guide establishes no universal success rate for MACD.

MACD indicator FAQ

What does the MACD indicator measure?

It measures the difference between a faster and slower moving average. A signal line smooths that difference, and a histogram shows MACD minus Signal. The default EMA version provides price-derived trend and momentum context.

What does 12, 26, 9 mean on MACD?

In TradingView's default configuration, 12 and 26 are the fast and slow price EMA lengths. Nine is the length of the EMA applied to MACD for the signal line. The lengths count calculation bars, not fixed holding periods.

Can MACD be below zero with a positive histogram?

The MACD line can be below zero while the histogram is positive. For example, MACD −2 minus Signal −3 equals Histogram +1. The fast price MA remains below the slow MA, while MACD is above its signal.

Is a green MACD bar a buy signal?

Read the series definition, its sign and the preceding value first. Colors can be changed. A positive histogram establishes that MACD is above Signal; a complete entry rule still needs price confirmation, execution, invalidation and exit conditions.

What does a shrinking MACD histogram mean?

When bars approach zero, the distance between MACD and Signal is shrinking. Positive bars can shrink while remaining positive, and negative bars can shrink while remaining negative. Contraction does not guarantee a price reversal.

Is a histogram zero crossing the same as MACD crossing zero?

No. Histogram zero corresponds to MACD equaling its signal line. MACD zero corresponds to the fast price moving average equaling the slow one. They compare different series and can occur at different times.

What are the best MACD settings for a five-minute chart?

No universally best setting is established here. Close, 12/26/9, EMA for both MA type fields and Chart timeframe provide a reproducible baseline. Compare changes using fixed trading rules, costs and a separate evaluation sample.

How do I add MACD on TradingView?

Open Indicators, metrics, and strategies, search MACD, and choose the built-in Moving average convergence divergence under Technicals. Double-click the MACD label to inspect Inputs. The separate MACD strategy and community scripts can behave differently.

Why does MACD differ on MetaTrader 5?

One difference is the signal average: MetaTrader 5's documented built-in calculation uses an SMA, while TradingView's default uses an EMA. Also match the price source, symbol, history, sessions, timeframes and the definition of the displayed bars.

Is MACD a leading or lagging indicator?

MACD is calculated from observed prices and moving averages, so it contains lag. Histogram contraction can precede a signal-line crossover, but that does not give it knowledge of a future price reversal.

What is MACD bullish or bearish divergence?

Regular bullish divergence pairs a lower price low with a higher MACD low. Regular bearish divergence pairs a higher price high with a lower MACD high. Specify the oscillator series and corresponding pivots, then account for confirmation timing.

Why can a crossover disappear before the candle closes?

The current closing input changes as the candle develops. MACD and Signal can cross and separate before the final close. Higher-timeframe values can also develop while their bar is open. Use the same completion rule in testing and live observation.

Which is better, RSI or MACD?

They measure different relationships. RSI expresses smoothed gains relative to losses on a 0–100 scale; MACD compares moving averages in price units. Choose a role within explicit rules and evaluate its contribution instead of assuming one is universally better.

What is the success rate of MACD?

There is no single rate that applies across instruments, timeframes, entry rules, exits and costs. A measured rate needs a defined strategy and sample. The settings and examples here do not establish a verified win rate or profitability claim.

Compare HDP discounts

Lucid 30% · Tradeify 30% · TPT 50%.

See current offers ↗

Eligible partner plans only.