Created
January 5, 2017 08:40
-
-
Save junajan/4e1be6f7926e176fbd7c404470af8133 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
var MarketData = require("barchart-market-data-api"); | |
var code = "6c0c63ab7c0bc4d3ea113ad26789e64c" | |
var md = new MarketData(code); | |
var ops= { | |
startDate: '20100101', | |
endDate: '20170101', | |
maxRecords: 1000000 | |
} | |
md.getHistory('IBM', 'dailyContinue', ops).then(function (history) { | |
console.log(" ===== LEN: %d =====", history.length) | |
console.log("FIRST:", history[0]) | |
console.log("LAST:", history[history.length - 1]) | |
// console.log('History data:', history); | |
}); | |
============= RES ============= | |
===== LEN: 505 ===== | |
FIRST: { symbol: 'IBM', | |
timestamp: '2015-01-05T00:00:00-05:00', | |
tradingDay: '2015-01-05', | |
open: 150.4377, | |
high: 150.4377, | |
low: 148.4974, | |
close: 148.7959, | |
volume: 5231706, | |
openInterest: null } | |
LAST: { symbol: 'IBM', | |
timestamp: '2017-01-04T00:00:00-05:00', | |
tradingDay: '2017-01-04', | |
open: 167.77, | |
high: 169.87, | |
low: 167.36, | |
close: 169.26, | |
volume: 3381400, | |
openInterest: null } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment