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.
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.
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:
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.
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
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.
Historical simulations are not live results. Nothing on this site is investment advice.