Page 1 of 1
Why the same RSI(14) and EMA(20) differ between two platforms: seeding and warm up
Posted: Sat Oct 24, 2026 1:14 pm
by Fairman
Why the same RSI(14) and EMA(20) differ between two platforms: seeding and warm up
Recursive indicators carry a memory of where they started. A Wilder smoothed RSI(14) or ATR(14) updates with a weight of 1/14 and keeps the previous value times 13/14, so after n bars the influence of the starting value is (13/14) to the power n.
After 14 bars: 35%. After 28: 12.5%. After 50: 2.5%. After 100: 0.06%.
EMA(20) uses alpha 2/21, so the leftover weight of its seed is (19/21) to the power n: 13.5% after 20 bars, 1.8% after 40, 0.25% after 60.
Where it bites: platforms seed differently, with some starting from the first close and others from a simple average of the first n values, and charts loaded with 300 bars start the recursion in a different place from charts with 5,000. Suppose two platforms start RSI(14) from values 10 points apart. After 28 bars the displayed difference is still 1.25 points. After 50 bars it's 0.25.
So if two screenshots disagree by a point or two around a threshold like 30, check how much history each chart has loaded before blaming the formula. A chart with only 60 bars on it hasn't finished forgetting its seed.
Re: Why the same RSI(14) and EMA(20) differ between two platforms: seeding and warm up
Posted: Tue Oct 27, 2026 6:19 pm
by FXS HongKong Scalper
The decay numbers are a great way to show it. Practical tip for EA builders: load at least 100 bars of history before trusting any Wilder smoothed value, and in the strategy tester start the test a week earlier than the period you care about. Comparing values with another platform only makes sense after both have had plenty of warm up. Otherwise a mismatch of a few points in RSI at the start of the data is just the seed showing through.
Re: Why the same RSI(14) and EMA(20) differ between two platforms: seeding and warm up
Posted: Sat Oct 31, 2026 1:03 am
by Fairman
A simple experiment shows the memory directly. Open the same symbol and timeframe on two platforms, or two terminals, and set both to load 1,000 bars. Compare RSI(14) on the latest bar. Then scroll one chart back, or reduce its history to 100 bars, and watch the value change. With 100 bars behind it, the seed's contribution is 0.06% of the starting gap, which on a 10 point difference is 0.006 points, below anything you could see on a chart. The values converge to the same number once there's enough history, which tells you the formulas agree and only the starting points differ.
Re: Why the same RSI(14) and EMA(20) differ between two platforms: seeding and warm up
Posted: Sat Oct 31, 2026 1:46 am
by Fairman
For EMA(20), a seed gap of 20 pips fades to 0.05 pip after 60 bars (20 times 0.0025). That's why a moving average line on a chart with a year of history looks identical across platforms, and why the same line on a freshly opened short chart can sit a few pips off. Another source of difference is that some platforms seed with the first close and others with the average of the first 20 closes. These choices only matter in the first couple of hundred bars. Nobody trades the first 200 bars of a chart, but you may be running a backtest on a short data sample.
Re: Why the same RSI(14) and EMA(20) differ between two platforms: seeding and warm up
Posted: Sat Oct 31, 2026 3:52 am
by Fairman
In an EA, don't read signals from an indicator until there's enough history behind it. A sensible minimum is 100 bars beyond the indicator period for RSI and ATR, and 60 for an EMA of 20. Check Bars() on the symbol and timeframe at startup, and skip signals until it's reached. This matters most after a symbol or timeframe is first opened, when the terminal may still be downloading history, and during backtests that start at the beginning of the data. A signal in the first few bars of a backtest is based on an indicator that hasn't settled, so it's best to start counting trades after the warm up.
Re: Why the same RSI(14) and EMA(20) differ between two platforms: seeding and warm up
Posted: Sat Oct 31, 2026 4:15 am
by Fairman
If you calculate in Python, the library choice matters. In pandas, ewm with alpha=1/14 and adjust=False starts from the first value, while adjust=True divides by the sum of the weights, which gives different numbers over the first 50 or so bars and then converges. TA-Lib's RSI seeds with an average of the first 14 changes, and it has a setting called the unstable period for skipping the early values. If a Python result differs from the platform on the latest bar, compare on a long series, because the first few hundred values are where the methods differ and the last ones agree.