Close price of nifty not matching with tradingview data

Here is the log

<pre>
History
                               open     close      high      low
2021-11-29 00:00:00+05:30  17055.80  17039.70  17160.70  16782.4
2021-11-30 00:00:00+05:30  17051.15  16975.15  17324.65  16931.4</pre>
<br />
```<br />
&nbsp;
<pre>
<code class="language-python">def initialize(context):
    """
        A function to define things to do at the start of the strategy
    """
    
    # universe selection
    context.universe = [symbol('NIFTY')]

    schedule_function(run_strategy,
                    date_rules.every_day(),
                    time_rules.market_open(hours=0, minutes=0))    
    

def run_strategy(context, data):
    print(f"{get_datetime()}\n")
    history = data.history(context.universe[0], ["open","close","high","low"], 2, "1d")
    print("History")
    print(history)
    print('-'*40)</code></pre>
I am able to match all prices except <strong>close </strong>price with tradingview<br />
Am I missing something here ?

I am unable to match NIFTY INDEX FUTURES(CONTINOUS)

context.universe = [symbol('NIFTY-I')]

<pre>
                             open     close      high       low
2021-11-01 00:00:00+05:30  17814.75  18084.77  18105.59  17796.74
2021-11-02 00:00:00+05:30  18077.79  17990.36  18105.85  17928.18
2021-11-03 00:00:00+05:30  18028.61  17930.14  18087.58  17836.84
2021-11-04 00:00:00+05:30       null       null       null       null
2021-11-08 00:00:00+05:30  18015.36  18203.26  18221.28  17919.15
2021-11-09 00:00:00+05:30  18198.19  18143.24  18209.03  18061.38</pre>
<br />
```<br />
I am attaching <a href="http://drive.google.com/file/d/1SSuQdRhe1Sfv2quoOuRtoHsytL8Y6VDm/view?usp=sharing" target="_blank">data from TV</a> for ref<br />
&nbsp;

I cannot comment on the quality of the data from trading view. Please note, on Blueshift, the close data is the last traded price for the day (and not the exchange reported or consolidated close price as usually found on most websites). This is to safegurad against look-ahead bias in case this (which is usually available much after market close) is used as a signal in a strategy. Also, while checking continuous futures data, you need to know about the methodology used by the source. On Blueshift we use backward ratio method with default roll date on the date of expiry of the contract. Also most such methodologies can introduce look-ahead bias. To protect that, on Blueshift we compute these adjustements on POV basis. That is, the adjustment is calculated and applied dynamically by reading all past dated futures prices and computing the ratios on-the-fly. This is done for each history method call and no pre-computed ratios are used. This is similar to the ways we handle corporate actions adjustments.



If you want to report data mismatch, please attach the data you see on blueshift and the values you expected. Also please clearly mention your source and where applicable, the methodology used.

Hmm…I dint know the nuances in the data :slight_smile:

Thanks for explaining in detail

I would use this as reference to understand the data !

Thanks

Prasanna