Wrong OHLC Values

ComT
ComT edited August 2019 in Python client
@sujith @tonystark
What's wrong with Historical API ? It's always giving wrong Last candle.

Suppose, yesterday @ the time of market (MCX) closing, I fetched last candle (from 23:15 to 23:30) @ 23:32.
But Historical API giving me wrong OHLC values at the time of market close. I also checked this on following dates: ( 26, 29, 30, 31 ) .
On every day last candle giving wrong OHLC values.
As this difference in OHLC leads to wrong calculations outputs.

I also checked this with charts. What I found that chart and Historical API have different OHLC values at the time of market closing.
Chart OHLC: {4027, 4035, 4027, 4034}
Historical API OHLC: {'4027', '4032', '4027', '4029'}

Screenshot:





  • rakeshr
    @ComT
    The last tick which you fetched is its Last Traded Price(LTP). This is the price at which the last trade of the day took place in that counter.
    And the end of the day, the close value of the chart is processed.
    The closing price of the stock is the weighted average of the last 30 minutes of trading. The LTP of the day and the Closing Price are usually never the same.
  • ComT
    ComT edited August 2019
    @rakeshr @sujith @tonystark

    @rakeshr : are you associated with zerodha or not ?

    I also request you to read question once more.
    I'm not talking about LTP or tick data.
    I'm talking about complete OHLC candle which is constructed from 23:15 to 23:30. The candle which I get for last 15 minutes.
    I'm using python library and the function which I used to fetch 15 min candle is:

    historical_data( self, instrument_token, from_date, to_date, interval, continuous=False)

    I don't think you get the point.
Sign In or Register to comment.