Query regarding historical data

hiralzala
Can I get three minute candle historical data using below function?

public void getHistoricalData(KiteConnect kiteConnect) throws KiteException {
/** Get historical data dump, requires from and to date, intrument token, interval
* returns historical data object which will have list of historical data inside the object*/
Map param8 = new HashMap(){
{
put("continuous", 0);
put("from", "2017-10-09 15:00:00");
put("to", "2017-10-09 15:03:00");
}
};
HistoricalData historicalData = kiteConnect.getHistoricalData(param8, "256265", "3minute");
System.out.println(historicalData.dataArrayList.size());
System.out.println(historicalData.dataArrayList.get(0).volume);
System.out.println(historicalData.dataArrayList.get(historicalData.dataArrayList.size() - 1).volume);
}

  • sujith
    Hi @hiralzala,
    The code seems fine.
    You need an active historical data subscription to access this.
  • sujith
    If you have just started, don't use this. The old APIs are being deprecated. You need to use Kite Connect 3 APIs.
    Check out kite3 branch on javakiteconnect repository.
Sign In or Register to comment.