Sunday, December 31, 2017

Why the same indicator is different on different platforms


Sometimes you may notice that the same indicator plots slightly different on different platforms.

Before we start, you need to understand what is an indicator, basically, it's a series of mathematical functions that takes price data as input source and output graphical plot after calculation.

For example, RSI value is different on Thinkorswim and Tradingview, it's also different on Ninjatrader, MT4 and other platforms.

The following table shows the RSI value on both Thinkorswim and Tradingview with same input.

The difference is quite obvious.
symbol:spy
timeframe:5 minute
date:12/29/2017
time:15:55
Thinkorswim RSI(14): 28.6996
Tradingview RSI(14): 28.1607

Let's see what caused the difference.
The following is the formula of Relative Strength Index - RSI

rma is the Wilders Moving Average.

  u = max(close - close[1], 0) // upward change
  d = max(close[1] - close, 0) // downward change
  rs = rma(u, length) / rma(d, length)
  rsi = 100 - 100 / (1 + rs)
 
  
 
Both Thinkorswim and Tradingview use the same RSI formula, so the reason is not because of different algorithm.



There are only two possibilities, first one is the formula, another one is the source (data feed).


The following table shows the Close price value on both Thinkorswim and Tradingview from 
symbol:spy
timeframe:5 minute
date:12/29/2017


timeThinkorswimTradingviewdifference
15:55266.88266.860.02
15:50267.05267.050
15:45267.4267.40
15:40267.28267.29-0.01
15:35267.36267.350.01


Looks like we find out the reason, RSI's formula depends on (close - close[1]), and the Close price is different on Thinkorswim and Tradingview, that's the main reason RSI has different value on both platforms.

If you check the Daily timeframe you should see that the Close price is almost exactly the same on both Thinkorswim and Tradingview, and the RSI value is the same on both sides. Because the intraday data is different, that's why you can get same RSI on Daily or higher timeframes, but not on minutes chart.

Next time when you see an indicator has different plot on different platforms, make sure you check the price data first. Since most indictors use the same algorithm on all platforms unless it's a custom indicator.









No comments:

Post a Comment