PSAR value in Tradingview vs ChartIQ

The Value of PSAR for the same candlesticks donot match in Tradingview and ChartIQ
I will attach screen shots to explain the same.

  1. Trading view chart - Nifty Spot 5min chart - 22- April -2020 : 11:20 : PSAR = 9074.0282

Also you can notice the slope of the PSAR till 11.20. At 11:25 the PSAR suddenly flattens and value shown is exactly the low of 11:25 candle. It should actually have flipped above but did not happen. This is clearly wrong. PSAR cant suddenly flatten like this.
This problem actually occurs in several places. Not just here.

  1. ChartIQ chart - Nifty Spot 5min chart - 22- April -2020 : 11:20 : PSAR = 9061.88

It seems that both platforms use the same data but come up with PSAR values that are radically different.
Some people use PSAR for trailing stoploss. A gap of 13 points is big. And given that this happens at several such places please look into this matter


The happens because both chart providers use a slightly different formula in calculating the indicators, and PSAR is not the only one, it also Supertrend and many other which have these differences.

In my testing, PSAR of chart IQ(CIQ) is more stable compared to that of TradingView(TV), because TV PSAR flips even when the high/low touches the PSAR, even true for supertrend, where as CIQ, waits for close to touch.

Similarly Renko calculation also differ slightly, and as both these chart providers are providing proprietary solutions, you cannot actually see and compare and change the formulas, it is what it is. There are differences in few other advanced indicators too, purely based on different assumption these guys have taken in rounding, in multiplying, selecting starting points for calculations,etc , and other more complicated operations.

Background: Have studied TV charts a lot and have written custom TV indicators(private) on and while doing that have uncovered these facts.

Also in my view, if your trading strategy is good, this much variation should not matter to much.

There is nothing proprietary about the formulas that trading view as well and ChartIQ use. I will demonstrate this.

i have given the code to calculate PSAR in python here : Link to PSAR code in python

Now I did the following:

  1. I first took the subscription of Historical API of zerodha and downloaded 3 months of data for NIFTY spot
  2. Then I ran the code for calculating PSAR on the data. The PSAR values that i calculate match with those that are shown in ChartIQ.

As explained previously the values dont match within Tradingview Chart within Zerodha

I went to actual tradingview website : and did the following

  1. I took a free trial version of Tradingview PRo +.
  2. I added PSAR to the 5min Nifty 50 chart and then exported the chart to csv.
  3. Now I have candlesticks from Tradingview and PSAR also calculated by original tradingview website itsellf.
  4. I ran my PSAR code on the Tradingview candlestick.
  5. Surprise… Surprise … The PSAR I calculate matches exactly with PSAR calculated by tradingview after a initial gap of about 40 candles.

So PSAR I calculated matches with

  1. PSAR calculated using Zerodha data which is shown in CHARTIQ chart
  2. PSAR calculated in tradingview using tradingview data.

It does not match with psar calculated in tradingview chart which is integrated in Zerodha. :crazy_face:

Tradingview gives charting library integration.
This is what zerodha has integrated with kite. Then how is it possible that calculation of PSAR matches with tradingview itself but not the tradingview integration of zerodha.

Only possible solution I can think of is that the version of tradingview library that zerodha has integrated is not the same as one that tradingview itself is using.

Also … my trading strategy is not good. For me the 13 points matter. Because for Nifty 13 points is 1000rs.

1 Like

All of this because of the facts mentioned here Why does the same technical charts for the same stock from NSE Tame, Google finance, Yahoo finance, Amibroker, not match?

Short answer : Candles on tradingview website are different to those candles in Kite.

But I am talking about difference b/w the calculations when the candle data is same.

When the underlying data is same, TV and ChartIQ produce different results on Kite, and its a easily verifiable task. This is because of the reasons i explained above. TV uses standard formulas and has publicly showcased them on their website, ChartIQ not so transparent, and have done very fine changes not noticeable in regular use.

Also if you strategy for nifty needs 13points(basically super narrow scalp) then you will need super costly exchange feed level 2 tick data feed to be able to do anything fruitful with that strategy.