How to get historical data for old NFO

Ajax
Hi @sujith

Is there a way to get historical data for expired NFOs ?

As the instruments call does not return the expired NFOs, we do not have the instrument token to make the historical call.
  • sujith
    Hi,
    You can check continuous feature mentioned here https://kite.trade/docs/connect/v1/#historical-data

    You just need to pass continuous=1 as param to get historical data for expired contracts.

    PS: We only have day's candle for expired contracts.
  • Ajax
    Ajax edited October 2017
    @sujith But how do I get the token for the expired contracts ?
  • Ajax
    @sujith Need your help here.
  • Ajax
    Ajax edited October 2017
    @sujith BTW I have tried getting the current token and using the same to get historical data.
    Does not work

    KOTAKBANK17OCT780PE - has instrument token 12995330

    https://api.kite.trade/instruments/historical/12995330/day?from=2017-02-01&to=2017-02-20&continuous=1

    gives me the following data: (no idea what this data is, clearly not the option OHLC)
    {
    "status": "success",
    "data": {
    "candles": [
    [
    "2017-02-03T00:00:00+0530",
    774.05,
    774.05,
    774,
    774,
    2400
    ],
    [
    "2017-02-14T00:00:00+0530",
    794.7,
    794.7,
    794.7,
    794.7,
    800
    ],
    [
    "2017-02-17T00:00:00+0530",
    807.5,
    807.5,
    807.5,
    807.5,
    1600
    ],
    [
    "2017-02-20T00:00:00+0530",
    806.5,
    806.5,
    806.5,
    806.5,
    800
    ]
    ]
    }
    }
  • sujith
    Hi,
    I just tried and I got this response
    {
    status: "error",
    error_type: "InputException",
    message: "No candles found based on token and time and candleType."
    }
  • Ajax
    @sujith what do you mean ? Can you answer my original question on how to get the token for an expired contract. Clearly using the current token does not works.
  • sujith
    Hi @Ajax,
    Check out this thread.
    It is available for only future contracts and not options contracts.
    For options contracts, it won't be continuous charts data since it will end at zero every month.
    If you want data then you can check out NSE website for Bhav copy. Again exact strike price may not be available if it has undergone some corporate action in between JAN to OCT.
Sign In or Register to comment.