/ Notes

RSI(14) is two different indicators, and the label doesn’t tell you which

Paste an RSI(14) from one platform beside an RSI(14) from another, on the same data, and the two lines can refuse to sit on top of each other. Usually neither is broken. They are two different averages wearing the same label.

The one constant

RSI averages the up moves and the down moves separately, then compares them. The question is how it averages.

Wilder's original RSI, the one TradingView's built-in RSI and Pine's ta.rsi() use, puts a weight of 1/n on the newest bar. At n = 14 that is 0.0714.

A conventional exponential moving average of length 14 puts 2/(n + 1) on the newest bar: 0.1333, nearly twice as much.

Solve 2/(m + 1) = 1/14 and you get m = 27. Wilder's 14 behaves like an EMA of about 27.

Measured as average lag, the 14-period EMA trails by 6.5 bars and Wilder's 14 by 13. Exactly double.

How often it changes a rule

A threshold rule is where this bites. Take “enter when RSI(14) crosses below 30” on BITFINEX:BTCUSD daily closes from 2021-10-31 to 2026-10-03:

  • Wilder's version crossed below 30 on 22 days.
  • The EMA version crossed below 30 on 55 days.
  • They crossed on the same bar 3 times.
  • Against each of Wilder's 22, the nearest EMA cross came earlier 18 times, on the same bar 3 times and later once.

Same symbol, same length, same threshold. If the rule was selected on one smoothing and is running on the other, the live rule is not the rule that was tested, and nothing in the code looks wrong because the function name is identical.

ATR has the same ambiguity. It is also a smoothed average of a per-bar quantity, so a stop placed at “2 × ATR(14)” sits at a different distance depending on which average the platform used.

The check, in the order it costs least

  1. Find out which smoothing your library actually applies, in writing. Not by assumption, and not from the function name.
  2. Plot both on the same pane for the symbol and timeframe you trade, and read off the bars where they cross your threshold on different candles. The free script below does exactly this.
  3. Write the smoothing beside the length whenever you record a rule. RSI(14, Wilder) is a specification. RSI(14) is a label.

A free script to check your own chart

RSI Smoothing: Wilder vs EMA on TradingView draws both lines, marks every threshold cross for each version, and counts how many landed on the same bar over whatever history your chart has loaded. It is open source and uses only the chart's own bars, with no request.security, so there is no lookahead to get wrong.

Open the script on TradingView

Why this is on a verification site

Most backtests I look at don't fail on the strategy. They fail on something that never shows up in the code: the smoothing, the fill model, the cost line, the sample size. My own book's indicator chapter left this exact detail unspecified for ATR and RSI both, and an accuracy pass flagged it; the correction has shipped.

If you want the ten checks I run before I believe any backtest, they fit on one page.

Get the Backtest Verification Checklist

Historical simulations are not live results. Nothing on this site is investment advice.