It looks like you're new here. If you want to get involved, click one of these buttons!
kite.historical_data(instrument_token=738561,from_date='2018-01-01 09:15:00', to_date='2018-01-31 16:00:00', interval='5minute')
{'date': datetime.datetime(2018, 1, 31, 15, 25, tzinfo=tzoffset(None, 19800)), 'open': 962, 'high': 963, 'low': 961.05,'close': 962, 'volume': 242672}
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);});
Total Candles received: 74Mon 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)
npm view kiteconnect version
npm uninstall kiteconnect
npm install kiteconnect
Have you installed npm packages globally ?
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?
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)
Have you installed npm packages globally ?
Can you check kiteconnect node version using
npm view kiteconnect version
? It should be 3.0.1If not remove older version using
npm uninstall kiteconnect
and then donpm install kiteconnect
.npm install kiteconnect
) ?