last minute candle of the day (5mins data)

wtdmarketing
Hi,

I am fetching 5mins candle data for RELIANCE.NSE (738561).

I need one day candle data and hence my request parameter would be for example,
From: 2018-01-01 09:15:00
To: 2018-01-31 16:00:00

I only get candles up to 15:20:00, I am not getting last candle which is 15:25:00

However, If I choose end date as next day, it's giving me 15:25:00 of previous day

Can someone tell me what am I doing wrong or is there an error at Kite end? If so, can it fixed?

Regards,
Nayan
  • rakeshr
    @wtdmarketing
    We fetched historical candle for same above param for python client:
    kite.historical_data(instrument_token=738561,from_date='2018-01-01 09:15:00', to_date='2018-01-31 16:00:00', interval='5minute')
    We got last 5 minute candle of 15:25 as shown below:
    {'date': datetime.datetime(2018, 1, 31, 15, 25, tzinfo=tzoffset(None, 19800)), 'open': 962, 'high': 963, 'low': 961.05,'close': 962, 'volume': 242672}

    Can you recheck if you are entering correct TO datetime?
  • wtdmarketing
    Hi,

    I am using node.js client library and it does not return last candle. Here is my code:

    var KiteConnect = require("kiteconnect").KiteConnect;
    var access_token = "MY_ACCESS_TOKEN";

    var options = {
    "api_key": "MY_API_KEY",
    "debug": false
    };

    kc = new KiteConnect(options);
    kc.setAccessToken(access_token);

    kc.getHistoricalData(738561, "5minute","2018-01-01 09:15:00","2018-01-01 16:00:00", 0).then(function(data){
    console.log("Total Candles received: " + data.length);

    for(var i=0;i<data.length;i++)
    console.log(data[i].date.toString());

    }).catch(function(err)
    {
    console.log(err);
    });


    and here is the result of the program

    Total Candles received: 74
    Mon Jan 01 2018 09:15:00 GMT+0530 (IST)
    Mon Jan 01 2018 09:20:00 GMT+0530 (IST)
    Mon Jan 01 2018 09:25:00 GMT+0530 (IST)
    Mon Jan 01 2018 09:30:00 GMT+0530 (IST)
    Mon Jan 01 2018 09:35:00 GMT+0530 (IST)
    Mon Jan 01 2018 09:40:00 GMT+0530 (IST)
    Mon Jan 01 2018 09:45:00 GMT+0530 (IST)
    Mon Jan 01 2018 09:50:00 GMT+0530 (IST)
    Mon Jan 01 2018 09:55:00 GMT+0530 (IST)
    Mon Jan 01 2018 10:00:00 GMT+0530 (IST)
    Mon Jan 01 2018 10:05:00 GMT+0530 (IST)
    Mon Jan 01 2018 10:10:00 GMT+0530 (IST)
    Mon Jan 01 2018 10:15:00 GMT+0530 (IST)
    Mon Jan 01 2018 10:20:00 GMT+0530 (IST)
    Mon Jan 01 2018 10:25:00 GMT+0530 (IST)
    Mon Jan 01 2018 10:30:00 GMT+0530 (IST)
    Mon Jan 01 2018 10:35:00 GMT+0530 (IST)
    Mon Jan 01 2018 10:40:00 GMT+0530 (IST)
    Mon Jan 01 2018 10:45:00 GMT+0530 (IST)
    Mon Jan 01 2018 10:50:00 GMT+0530 (IST)
    Mon Jan 01 2018 10:55:00 GMT+0530 (IST)
    Mon Jan 01 2018 11:00:00 GMT+0530 (IST)
    Mon Jan 01 2018 11:05:00 GMT+0530 (IST)
    Mon Jan 01 2018 11:10:00 GMT+0530 (IST)
    Mon Jan 01 2018 11:15:00 GMT+0530 (IST)
    Mon Jan 01 2018 11:20:00 GMT+0530 (IST)
    Mon Jan 01 2018 11:25:00 GMT+0530 (IST)
    Mon Jan 01 2018 11:30:00 GMT+0530 (IST)
    Mon Jan 01 2018 11:35:00 GMT+0530 (IST)
    Mon Jan 01 2018 11:40:00 GMT+0530 (IST)
    Mon Jan 01 2018 11:45:00 GMT+0530 (IST)
    Mon Jan 01 2018 11:50:00 GMT+0530 (IST)
    Mon Jan 01 2018 11:55:00 GMT+0530 (IST)
    Mon Jan 01 2018 12:00:00 GMT+0530 (IST)
    Mon Jan 01 2018 12:05:00 GMT+0530 (IST)
    Mon Jan 01 2018 12:10:00 GMT+0530 (IST)
    Mon Jan 01 2018 12:15:00 GMT+0530 (IST)
    Mon Jan 01 2018 12:20:00 GMT+0530 (IST)
    Mon Jan 01 2018 12:25:00 GMT+0530 (IST)
    Mon Jan 01 2018 12:30:00 GMT+0530 (IST)
    Mon Jan 01 2018 12:35:00 GMT+0530 (IST)
    Mon Jan 01 2018 12:40:00 GMT+0530 (IST)
    Mon Jan 01 2018 12:45:00 GMT+0530 (IST)
    Mon Jan 01 2018 12:50:00 GMT+0530 (IST)
    Mon Jan 01 2018 12:55:00 GMT+0530 (IST)
    Mon Jan 01 2018 13:00:00 GMT+0530 (IST)
    Mon Jan 01 2018 13:05:00 GMT+0530 (IST)
    Mon Jan 01 2018 13:10:00 GMT+0530 (IST)
    Mon Jan 01 2018 13:15:00 GMT+0530 (IST)
    Mon Jan 01 2018 13:20:00 GMT+0530 (IST)
    Mon Jan 01 2018 13:25:00 GMT+0530 (IST)
    Mon Jan 01 2018 13:30:00 GMT+0530 (IST)
    Mon Jan 01 2018 13:35:00 GMT+0530 (IST)
    Mon Jan 01 2018 13:40:00 GMT+0530 (IST)
    Mon Jan 01 2018 13:45:00 GMT+0530 (IST)
    Mon Jan 01 2018 13:50:00 GMT+0530 (IST)
    Mon Jan 01 2018 13:55:00 GMT+0530 (IST)
    Mon Jan 01 2018 14:00:00 GMT+0530 (IST)
    Mon Jan 01 2018 14:05:00 GMT+0530 (IST)
    Mon Jan 01 2018 14:10:00 GMT+0530 (IST)
    Mon Jan 01 2018 14:15:00 GMT+0530 (IST)
    Mon Jan 01 2018 14:20:00 GMT+0530 (IST)
    Mon Jan 01 2018 14:25:00 GMT+0530 (IST)
    Mon Jan 01 2018 14:30:00 GMT+0530 (IST)
    Mon Jan 01 2018 14:35:00 GMT+0530 (IST)
    Mon Jan 01 2018 14:40:00 GMT+0530 (IST)
    Mon Jan 01 2018 14:45:00 GMT+0530 (IST)
    Mon Jan 01 2018 14:50:00 GMT+0530 (IST)
    Mon Jan 01 2018 14:55:00 GMT+0530 (IST)
    Mon Jan 01 2018 15:00:00 GMT+0530 (IST)
    Mon Jan 01 2018 15:05:00 GMT+0530 (IST)
    Mon Jan 01 2018 15:10:00 GMT+0530 (IST)
    Mon Jan 01 2018 15:15:00 GMT+0530 (IST)
    Mon Jan 01 2018 15:20:00 GMT+0530 (IST)
  • rakeshr
    @wtdmarketing
    Have you installed npm packages globally ?
    Can you check kiteconnect node version using npm view kiteconnect version ? It should be 3.0.1
    If not remove older version using npm uninstall kiteconnect and then do npm install kiteconnect.
  • wtdmarketing
    Yes, I am using version 3.0.1
  • rakeshr
    @wtdmarketing
    Have you installed npm packages globally ?
    It's npm env issue.Can you create local env and then install npm and then install kite connect node client(npm install kiteconnect) ?
Sign In or Register to comment.