Created
September 1, 2021 05:31
-
-
Save shreyas1496/b635c68fc0da0072a66c8cb65cb96c65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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