code: public HistoricalData getHistoricalData(Date from, Date to, String token, String interval, boolean continuous) throws KiteException, IOException, JSONException {
          SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
          Map<String, Object> params = new HashMap<>();
          params.put("from", format.format(from));
          params.put("to", format.format(to));
          params.put("continuous", continuous ? 1 : 0);
  
          String url = routes.get("market.historical").replace(":instrument_token", token).replace(":interval", interval);
          HistoricalData historicalData = new HistoricalData();
          historicalData.parseResponse(new KiteRequestHandler(proxy).getRequest(url, params, apiKey, accessToken));
          return historicalData;
      }
docs: Retrieves historical data for an instrument.
  @param from "yyyy-mm-dd" for fetching candles between days and "yyyy-mm-dd hh:mm:ss" for fetching candles between timestamps.
  @param to "yyyy-mm-dd" for fetching candles between days and "yyyy-mm-dd hh:mm:ss" for fetching candles between timestamps.
  @param continuous set to true for fetching continuous data of expired instruments.
  @param interval can be minute, day, 3minute, 5minute, 10minute, 15minute, 30minute, 60minute.
  @param token is instruments token.
  @return HistoricalData object which contains list of historical data termed as dataArrayList.
  @throws KiteException is thrown for all Kite trade related errors.
  @throws IOException is thrown when there is connection related error.