Skip to content

Instantly share code, notes, and snippets.

@shreyas1496
Created September 1, 2021 05:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shreyas1496/b635c68fc0da0072a66c8cb65cb96c65 to your computer and use it in GitHub Desktop.
Save shreyas1496/b635c68fc0da0072a66c8cb65cb96c65 to your computer and use it in GitHub Desktop.
// Run this script as: node historical.js <api-key> <api-secret> <request-token>
// Expected it should return correct values for close and volume for the duration, however it does not
const api_key = process.argv[2];
const api_secret = process.argv[3];
const request_token = process.argv[4];
var KiteConnect = require("kiteconnect").KiteConnect;
var kc = new KiteConnect({
api_key,
});
kc.generateSession(request_token, api_secret)
.then(function (response) {
kc.getHistoricalData(
12492546,
"day",
"2021-08-16 00:00:00",
"2021-08-31 00:00:00",
true
)
.then(function (response) {
console.log(response);
})
.catch(function (err) {
console.log(err);
});
})
.catch(function (err) {
console.log(err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment