Mismatch is historical data

vivekmanot
Hi
I am extracting data for 1 minute candle of gail nse but in few candles i am getting a different price from the one which is plotted by zerodha. For instance today 10:53am 1 minute candle, i have received 121.15 as the closing price but in zerodha chart it is showing 121.20. Please explain.
  • vivekmanot
    I am finding this kind of mismatch in 1 candle after every 15 - 20 minutes. I am working with linebreak candles so due to this type of minor mismatch also the entire chart plotting is becoming extremely different than the 1 i find in zerodha charts.
  • sujith
    Can you run in debug mode and paste the complete request params here?
  • sriraj1122
    Hi Sujith,..I am also seeing differences in Open Interest for few derivative symbols. How can Irun in debug mode?
  • rakeshr
    You can go through this thread.
  • vivekmanot
    data = objKite.GetHistoricalData(token.ToString(), DateTime.Now.Date.AddHours(9).AddMinutes(15).AddDays(-3), DateTime.Now, "minute", false, false);
  • vivekmanot
    This is the request i am making but ohlc received is mismatching with candles formed in zerodha kite. Sharing few differences in escort. This kind of difference is coming in many scripts:

    Escort NSE candle closing price differences:
    Time Close Price from API Close Price in Kite
    12/23/2020 9:38 1268.95 1267.75
    12/23/2020 9:37 1262.5 1268
    12/23/2020 9:36 1259 1262.35

    Please check and revert.
  • rakeshr
    @vivekmanot
    You would be requesting wrong to and fro interval w.r.t kite web candle. You can go through this thread to understand this.
  • vivekmanot
    @sujith @rakeshr I have checked your thread but still the data being received is faulty. Below is the description of the code I am using to fetch 1 minute candle OHLC. I am working only over the close price so sharing the closing price of 1 minute candle of SBIN NSE as received from API. Mismatch is in minute - 15:16, 15:22, 15:24, 15:26, 15:27, 15:29. In just a period of 15 minutes i have received 6 mismatches. As i am working on Linebreak candle so even a minor change in closing price is changing the entire chart plotting.

    data = objKite.GetHistoricalData(token.ToString(), DateTime.Now.Date.AddHours(9).AddMinutes(15).AddDays(-3), DateTime.Now, "minute", false, false);

    Desc:
    DateTime.Now.Date.AddHours(9).AddMinutes(15) ==>from==> Means data start from 3 day back from 9:15 am

    DateTime.Now ==>to==> Means current time


  • rakeshr
    @vivekmanot
    There can't be a mismatch between Kite Web and Kiteconnect API Historical data, as both use the same DB. So, until there is some difference for the fetch period param, there can't exist a difference.
  • vivekmanot
    @rakeshr fetched above data after market hours but still mismatch. Shared above the code also which I am using. Please help as not able to make out where the fault is. Anticipating your cooperation.
  • vivekmanot
    Something i would like to share with you. Yesterday in SBIN NSE chart in Kite Web, the closing price was:
    1. 15:16 - 266.5
    2. 15:22 - 266.25
    3. 15:24 - 266.10
    4. 15:26 - 266.5
    5. 15:27 - 266.70
    6. 15:29 - 266.90

    But now it is showing:
    1. 15:16 - 266.7
    2. 15:22 - 266.2
    3. 15:24 - 266.15
    4. 15:26 - 266.7
    5. 15:27 - 266.85
    6. 15:29 - 266.85

    I was getting the changed price which I am able to see right now, from Kite API in live market.

    This is causing a difference in formation of LINEBREAK candles in live market and off market. Can you please explain this.
  • vivekmanot
    Awaiting your reply
  • sujith
    @vivekmanot,
    The historical data is provided for backtesting purposes only. You need to fetch the whole dump in the loop at your end and use that as the source.
    For live strategies, we recommend you to make candles at your end using the live market data provided via Websockets API. You can get started here.
  • sujith
    Since candles are formed at our end like how it is mentioned in the thread for all instruments that are traded for the day, it is not guaranteed that at the end of the minute the candle is formed.
This discussion has been closed.