TradingView indicator comparisons

MACD vs RSI: compare the measurement before the signal

RSI measures the balance of smoothed gains and losses on a 0 to 100 scale. MACD measures the difference between fast and slow moving averages in price units. Use RSI for a rule about relative directional changes and MACD for a rule about average separation or its signal-line cross. Neither calculation establishes a universal winner. On the same flat closes below, RSI stays at 80 while the MACD histogram crosses below zero.

See the decision guide

What each calculation measures

For the same close series, split each price change into a positive gain and a positive loss magnitude. RSI = 100 × G / (G + L), where G and L are Wilder-smoothed gains and losses and the denominator is nonzero. For EMA-based MACD, M = EMA(fast) − EMA(slow); its signal is a moving average of M, and its histogram is M − signal. TradingView also offers SMA choices, so record both average-type settings.

  • Matching a length number does not match these calculations. RSI(14) applies weight 1/14 to each new gain or loss; EMA(14) applies 2/15 to its new input. An EMA(27) has the same 1/14 weight, but averaging closes still differs from averaging gains and losses.
  • If every historical price and the corresponding seeds are multiplied by 10, MACD and its signal also multiply by 10, while RSI is unchanged. This follows from the formulas; it is not a performance result. Raw MACD thresholds therefore do not transfer unchanged across differently priced assets.
PropertyRSIEMA-based MACD
ScaleBounded from 0 to 100.Unbounded; expressed in source-price units.
Reference50 means smoothed gains equal losses when their sum is positive.Zero means the fast and slow averages are equal.
SmoothingEach gain/loss average assigns weight 1/N to the newest change.Each EMA assigns weight 2/(N + 1) to its newest input.
MemoryOlder changes decay through the stored gain/loss averages.Older closes decay through both averages; the signal adds another smoothing stage.

Same closes: RSI stays high while the histogram turns negative

This hypothetical series uses short lengths to expose the arithmetic: RSI length 3; MACD fast EMA 2, slow EMA 4, signal EMA 2. Start at bar 0 with close 100, both price EMAs seeded at 100, and signal seeded at zero. Bars 1 and 2 close at 102 and 101. Initialize RSI on bar 3 from the first three changes, then update each gain/loss average as (2 × previous average + current gain or loss) / 3. These are teaching settings, not suggested trading parameters.

  • At bar 3 the changes are +2, −1, +2, giving G = 4/3 and L = 1/3. RSI = 100 × 4/5 = 80. At bars 4 and 5 both averages decay by 2/3, so their ratio stays unchanged despite zero new gains.
  • At bar 5 the fast EMA is 102.9300 and the slow EMA is 102.5421 before display rounding. Their difference is approximately 0.3880. Subtracting the signal of 0.4393 produces a negative histogram even though MACD itself remains positive.
  • On further unchanged closes the price EMAs approach the same price. MACD can contract while RSI retains its gain/loss ratio. A high RSI does not require price to keep rising on every bar.
  • All calculations retain full precision before display rounding. This seed convention makes the example reproducible; a chart with earlier history can show different initial values. If both RSI averages are zero, the ratio is undefined and a custom implementation needs an explicit handling rule.
BarCloseRSI (3)MACDSignalHistogram
310380.000.64240.51910.1233
410380.000.55330.54190.0114
510380.000.38800.4393−0.0513
610134.04−0.2819−0.0415−0.2404
710471.230.45930.29240.1669
810471.230.48510.42080.0642
910471.230.36090.3809−0.0200

Count events and define what delay means

Evaluate bars 4 through 9, using bar 3 only as the previous value for the first crossing test. Define an upward cross as current value strictly above the level and previous value at or below it; reverse those inequalities for a downward cross. Count both directions. These rules give different event counts on the same six completed bars.

  • The histogram crosses down one bar before RSI crosses below 70. The two MACD zero-cross rules also differ by one bar here. This is a measured timestamp difference in this sequence, not evidence that one indicator consistently leads price.
  • At bar 9, the histogram gives another downward event while the close remains 104 and RSI stays above 70. More events do not establish more information or more profitable opportunities.
  • Do not count every bar above 70 as a new crossing. Likewise, a negative histogram means MACD is below its signal; it does not necessarily mean the fast price average is below the slow one.
RuleDownward eventsUpward eventsTotal
RSI crosses 70Bar 6Bar 72
MACD histogram crosses zeroBars 5 and 9Bar 73
MACD line crosses zeroBar 6Bar 72

Compare RSI and MACD on one TradingView test window

Add both built-in indicators to the same standard candlestick chart. Use the same exchange symbol, session, adjustment settings, close source, chart interval, and date range. Keep separate panes because their units differ. A starting configuration to document is RSI(14) and EMA-based MACD(12,26,9); the numbers are an experimental choice, not evidence of equivalent memory or optimal settings.

  • Record the RSI length and any extra RSI average separately. For MACD record fast length, slow length, signal length, oscillator MA type, and signal MA type. Keep their indicator timeframes equal to the chart for the first comparison.
  • Load preceding history for initialization, exclude warm-up from the evaluation dates, and inspect both readings on the same closed candle in the Data Window. Current close values can change intrabar. Chart-bar confirmation alone does not confirm an unfinished higher-timeframe input.
  • Choose one rule per indicator before counting signals. Log timestamp, direction, indicator value, and threshold. Report events per 100 eligible closed bars and list matched-event timing differences; define the matching window beforehand and keep unmatched events visible.
  • Keep the calculation comparison separate from a strategy test. For a strategy, specify entries, exits, sizing, execution timing, commission, and slippage, then hold those assumptions fixed across versions. Preserve a later evaluation period that was not used to choose the rules.

Combining RSI and MACD adds a condition, not independent evidence

Both indicators here are transformations of the same closes. Their agreement does not provide two independent observations of the market. A combined rule can still be useful to investigate, but it needs its own test. For example, requiring RSI above 50 when the MACD histogram crosses upward is a state filter on an event; requiring both to cross on exactly the same bar is a different rule.

  • Compare three fixed versions: the RSI rule alone, the MACD rule alone, and the combined rule. Record which candidate events the extra condition accepts or rejects, along with exposure and results after costs if trading rules are defined.
  • A stricter condition can remove losing and winning trades alike. Neither lower activity nor a cleaner chart establishes improved accuracy. Repeated crosses in a range and persistent high RSI during an advance remain possible.

Draft a comparison panel with explicit inputs

Ask the Pine Script AI Coding Agent to draft a comparison table containing RSI, fast and slow EMAs, MACD, signal, histogram, and closed-bar event counts. Supply the exact source, lengths, average types, warm-up rule, dates, and crossing definitions. Check the generated calculations against the built-in indicators before adding orders. Keep RSI and MACD units labeled rather than forcing both onto one numerical scale.

  • Include the seeded sequence above as a separate arithmetic fixture. Do not expect a live chart to reproduce it unless its source history and initialization are identical.
  • Request separate rule modes for RSI, MACD, and their combination. The agent can draft code; code review, syntax validation, and chart verification are still required before interpreting any result.
Where Pineify fits

Pine Script AI Coding Agent

Draft an RSI/MACD comparison with explicit settings and separate signal rules. Review the generated script and verify its chart values.

Draft an RSI/MACD comparison

Frequently asked questions

Educational comparison, not investment advice. The price sequence is hypothetical and contains no simulated or live trades. Indicator readings, signal counts, and generated code do not establish profitability. Test complete rules independently and account for execution costs.

Sources and verification

Published by Pineify. Pineify is an independent product and is not affiliated with TradingView. Sources support the technical explanations; examples do not establish trading performance.