Historical data return's wrong data when I asked it for the same date.. after 12 that is on the next date it is returning correct data... Please resolve the issue... Below is my code that I ran on 2020-06-05 22:20:58 and then on 2020-06-06 00:18:45 -
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date from = new Date(); Date to = new Date(); try { from = formatter.parse("2020-06-05 09:15:00"); to = formatter.parse("2020-06-05 15:30:00"); }catch (ParseException e) { e.printStackTrace(); }
try { List historicalData = connection.getHistoricalData(from, to, "579329", "5minute", false, false).dataArrayList; for (HistoricalData candle : historicalData) { System.out.println("Time - "+candle.timeStamp+" Open - "+candle.open+" Close - "+candle.close+" Low - "+candle.low+" High - "+candle.high); } } catch (JSONException | IOException | KiteException e) { e.printStackTrace(); }
No @krtrader my issue is different. Suppose today is 5th May 2020 and I want today's 5 minute historical candle data of a stock at 18:00 hrs, the result i got is wrong. But if I run the same programme after 00:00 hrs that is on very next date all candles data are right.
Suppose today is 5th May 2020 and I want today's 5 minute historical candle data of a stock at 18:00 hrs, the result i got is wrong. But if I run the same program after 00:00 hrs that is on very next date all candles data are right.
To whom do you compare Historical APIs data with? Can you post here complete Historical data APIs response for both requests (multiple timings)?
@rakeshr finally i think i found the issue... If I ran the program in same date that is before 23:59 hrs. an extra candle is coming at end, who's timeStamp is 2020-06-08T15:30:00+0530. But it is not there if I run the program on next date... Was tried to upload full dateset of 2 different time-frame of TCS , but there is a comment limitation. so posting the response from 2020-06-08 14:00:00 to 2020-06-08 15:30:00 --
Starting at -------- Mon Jun 08 22:00:07 IST 2020 Time - 2020-06-08T14:00:00+0530 Open - 2116.0 Close - 2112.95 Low - 2112.15 High - 2117.0 Time - 2020-06-08T14:05:00+0530 Open - 2111.7 Close - 2118.05 Low - 2109.35 High - 2119.8 Time - 2020-06-08T14:10:00+0530 Open - 2118.05 Close - 2113.1 Low - 2113.1 High - 2124.5 Time - 2020-06-08T14:15:00+0530 Open - 2112.05 Close - 2111.8 Low - 2108.05 High - 2115.55 Time - 2020-06-08T14:20:00+0530 Open - 2111.85 Close - 2109.8 Low - 2105.0 High - 2112.55 Time - 2020-06-08T14:25:00+0530 Open - 2109.85 Close - 2111.0 Low - 2108.5 High - 2113.0 Time - 2020-06-08T14:30:00+0530 Open - 2111.05 Close - 2115.0 Low - 2110.3 High - 2116.8 Time - 2020-06-08T14:35:00+0530 Open - 2115.5 Close - 2113.9 Low - 2110.75 High - 2116.1 Time - 2020-06-08T14:40:00+0530 Open - 2113.75 Close - 2112.9 Low - 2110.85 High - 2114.7 Time - 2020-06-08T14:45:00+0530 Open - 2113.05 Close - 2111.9 Low - 2110.0 High - 2114.35 Time - 2020-06-08T14:50:00+0530 Open - 2111.9 Close - 2107.9 Low - 2106.3 High - 2112.0 Time - 2020-06-08T14:55:00+0530 Open - 2107.9 Close - 2107.15 Low - 2106.65 High - 2111.3 Time - 2020-06-08T15:00:00+0530 Open - 2107.35 Close - 2110.45 Low - 2107.35 High - 2113.95 Time - 2020-06-08T15:05:00+0530 Open - 2110.4 Close - 2113.0 Low - 2110.0 High - 2114.0 Time - 2020-06-08T15:10:00+0530 Open - 2113.0 Close - 2114.3 Low - 2110.6 High - 2114.55 Time - 2020-06-08T15:15:00+0530 Open - 2114.4 Close - 2112.3 Low - 2110.25 High - 2114.4 Time - 2020-06-08T15:20:00+0530 Open - 2112.3 Close - 2110.95 Low - 2110.05 High - 2115.0 Time - 2020-06-08T15:25:00+0530 Open - 2110.95 Close - 2110.3 Low - 2106.7 High - 2112.0 Time - 2020-06-08T15:30:00+0530 Open - 2110.3 Close - 2110.3 Low - 2110.3 High - 2110.3 Done at -------- Mon Jun 08 22:00:09 IST 2020
Starting at -------- Tue Jun 09 00:29:04 IST 2020 Time - 2020-06-08T14:00:00+0530 Open - 2116.0 Close - 2112.95 Low - 2112.15 High - 2117.0 Time - 2020-06-08T14:05:00+0530 Open - 2111.7 Close - 2118.05 Low - 2109.35 High - 2119.8 Time - 2020-06-08T14:10:00+0530 Open - 2118.05 Close - 2113.1 Low - 2113.1 High - 2124.5 Time - 2020-06-08T14:15:00+0530 Open - 2112.05 Close - 2111.8 Low - 2108.05 High - 2115.55 Time - 2020-06-08T14:20:00+0530 Open - 2111.85 Close - 2109.8 Low - 2105.0 High - 2112.55 Time - 2020-06-08T14:25:00+0530 Open - 2109.85 Close - 2111.0 Low - 2108.5 High - 2113.0 Time - 2020-06-08T14:30:00+0530 Open - 2111.05 Close - 2115.0 Low - 2110.3 High - 2116.8 Time - 2020-06-08T14:35:00+0530 Open - 2115.5 Close - 2113.9 Low - 2110.75 High - 2116.1 Time - 2020-06-08T14:40:00+0530 Open - 2113.75 Close - 2112.9 Low - 2110.85 High - 2114.7 Time - 2020-06-08T14:45:00+0530 Open - 2113.05 Close - 2111.9 Low - 2110.0 High - 2114.35 Time - 2020-06-08T14:50:00+0530 Open - 2111.9 Close - 2107.9 Low - 2106.3 High - 2112.0 Time - 2020-06-08T14:55:00+0530 Open - 2107.9 Close - 2107.15 Low - 2106.65 High - 2111.3 Time - 2020-06-08T15:00:00+0530 Open - 2107.35 Close - 2110.45 Low - 2107.35 High - 2113.95 Time - 2020-06-08T15:05:00+0530 Open - 2110.4 Close - 2113.0 Low - 2110.0 High - 2114.0 Time - 2020-06-08T15:10:00+0530 Open - 2113.0 Close - 2114.3 Low - 2110.6 High - 2114.55 Time - 2020-06-08T15:15:00+0530 Open - 2114.4 Close - 2112.3 Low - 2110.25 High - 2114.4 Time - 2020-06-08T15:20:00+0530 Open - 2112.3 Close - 2110.95 Low - 2110.05 High - 2115.0 Time - 2020-06-08T15:25:00+0530 Open - 2110.95 Close - 2110.3 Low - 2106.7 High - 2112.0 Done at -------- Tue Jun 09 00:29:06 IST 2020
@sujith please look into the issue.
Can you post here complete Historical data APIs response for both requests (multiple timings)?
If I ran the program in same date that is before 23:59 hrs. an extra candle is coming at end, who's timeStamp is 2020-06-08T15:30:00+0530.
But it is not there if I run the program on next date...
Was tried to upload full dateset of 2 different time-frame of TCS , but there is a comment limitation. so posting the response from 2020-06-08 14:00:00 to 2020-06-08 15:30:00 --
Starting at -------- Mon Jun 08 22:00:07 IST 2020
Time - 2020-06-08T14:00:00+0530 Open - 2116.0 Close - 2112.95 Low - 2112.15 High - 2117.0
Time - 2020-06-08T14:05:00+0530 Open - 2111.7 Close - 2118.05 Low - 2109.35 High - 2119.8
Time - 2020-06-08T14:10:00+0530 Open - 2118.05 Close - 2113.1 Low - 2113.1 High - 2124.5
Time - 2020-06-08T14:15:00+0530 Open - 2112.05 Close - 2111.8 Low - 2108.05 High - 2115.55
Time - 2020-06-08T14:20:00+0530 Open - 2111.85 Close - 2109.8 Low - 2105.0 High - 2112.55
Time - 2020-06-08T14:25:00+0530 Open - 2109.85 Close - 2111.0 Low - 2108.5 High - 2113.0
Time - 2020-06-08T14:30:00+0530 Open - 2111.05 Close - 2115.0 Low - 2110.3 High - 2116.8
Time - 2020-06-08T14:35:00+0530 Open - 2115.5 Close - 2113.9 Low - 2110.75 High - 2116.1
Time - 2020-06-08T14:40:00+0530 Open - 2113.75 Close - 2112.9 Low - 2110.85 High - 2114.7
Time - 2020-06-08T14:45:00+0530 Open - 2113.05 Close - 2111.9 Low - 2110.0 High - 2114.35
Time - 2020-06-08T14:50:00+0530 Open - 2111.9 Close - 2107.9 Low - 2106.3 High - 2112.0
Time - 2020-06-08T14:55:00+0530 Open - 2107.9 Close - 2107.15 Low - 2106.65 High - 2111.3
Time - 2020-06-08T15:00:00+0530 Open - 2107.35 Close - 2110.45 Low - 2107.35 High - 2113.95
Time - 2020-06-08T15:05:00+0530 Open - 2110.4 Close - 2113.0 Low - 2110.0 High - 2114.0
Time - 2020-06-08T15:10:00+0530 Open - 2113.0 Close - 2114.3 Low - 2110.6 High - 2114.55
Time - 2020-06-08T15:15:00+0530 Open - 2114.4 Close - 2112.3 Low - 2110.25 High - 2114.4
Time - 2020-06-08T15:20:00+0530 Open - 2112.3 Close - 2110.95 Low - 2110.05 High - 2115.0
Time - 2020-06-08T15:25:00+0530 Open - 2110.95 Close - 2110.3 Low - 2106.7 High - 2112.0
Time - 2020-06-08T15:30:00+0530 Open - 2110.3 Close - 2110.3 Low - 2110.3 High - 2110.3
Done at -------- Mon Jun 08 22:00:09 IST 2020
Starting at -------- Tue Jun 09 00:29:04 IST 2020
Time - 2020-06-08T14:00:00+0530 Open - 2116.0 Close - 2112.95 Low - 2112.15 High - 2117.0
Time - 2020-06-08T14:05:00+0530 Open - 2111.7 Close - 2118.05 Low - 2109.35 High - 2119.8
Time - 2020-06-08T14:10:00+0530 Open - 2118.05 Close - 2113.1 Low - 2113.1 High - 2124.5
Time - 2020-06-08T14:15:00+0530 Open - 2112.05 Close - 2111.8 Low - 2108.05 High - 2115.55
Time - 2020-06-08T14:20:00+0530 Open - 2111.85 Close - 2109.8 Low - 2105.0 High - 2112.55
Time - 2020-06-08T14:25:00+0530 Open - 2109.85 Close - 2111.0 Low - 2108.5 High - 2113.0
Time - 2020-06-08T14:30:00+0530 Open - 2111.05 Close - 2115.0 Low - 2110.3 High - 2116.8
Time - 2020-06-08T14:35:00+0530 Open - 2115.5 Close - 2113.9 Low - 2110.75 High - 2116.1
Time - 2020-06-08T14:40:00+0530 Open - 2113.75 Close - 2112.9 Low - 2110.85 High - 2114.7
Time - 2020-06-08T14:45:00+0530 Open - 2113.05 Close - 2111.9 Low - 2110.0 High - 2114.35
Time - 2020-06-08T14:50:00+0530 Open - 2111.9 Close - 2107.9 Low - 2106.3 High - 2112.0
Time - 2020-06-08T14:55:00+0530 Open - 2107.9 Close - 2107.15 Low - 2106.65 High - 2111.3
Time - 2020-06-08T15:00:00+0530 Open - 2107.35 Close - 2110.45 Low - 2107.35 High - 2113.95
Time - 2020-06-08T15:05:00+0530 Open - 2110.4 Close - 2113.0 Low - 2110.0 High - 2114.0
Time - 2020-06-08T15:10:00+0530 Open - 2113.0 Close - 2114.3 Low - 2110.6 High - 2114.55
Time - 2020-06-08T15:15:00+0530 Open - 2114.4 Close - 2112.3 Low - 2110.25 High - 2114.4
Time - 2020-06-08T15:20:00+0530 Open - 2112.3 Close - 2110.95 Low - 2110.05 High - 2115.0
Time - 2020-06-08T15:25:00+0530 Open - 2110.95 Close - 2110.3 Low - 2106.7 High - 2112.0
Done at -------- Tue Jun 09 00:29:06 IST 2020