Continuous expired futures historical data not giving 5mins candles

mailboxofrafiq
@sujith @rakeshr I am trying to get historical 5 mins candle data of expired future contract. But it is throwing input exception in java. Whereas if I change candle to 'day' it is working fine. How to get 5mins candle data?

public void testContinuous(KiteConnect kiteConnect) throws KiteException, IOException {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date from = new Date();
Date to = new Date();
try {
from = formatter.parse("2022-01-01 09:00:00");
to = formatter.parse("2022-01-04 09:00:00");
} catch (ParseException e) {
e.printStackTrace();
}

HistoricalData historicalData = kiteConnect.getHistoricalData(from, to, "16079106", "5minute", true, true);
for (int index = 0; index < historicalData.dataArrayList.size(); index++) {
System.out.println(historicalData.dataArrayList.get(index).timeStamp + "~" + historicalData.dataArrayList.get(index).oi);

}

}
  • DD1365
    @mailboxofrafiq It's not available in Zerodha.. Zerodha charges 2000 pm for their historical API but they don't provide such basic historical information like minute level data for expired F&O contracts.

    I personally use my old ICICI Direct account's API for historical data, they provide minute level data for all expired contracts from past 3 years and the API is free, you just need to have an account.
  • rakeshr
    Whereas if I change candle to 'day' it is working fine. How to get 5mins candle data?
    Currently, continuous data is available only for day candles.
Sign In or Register to comment.