Similar to create an OHLC data from Date, time, price using Javascript, how does one take the theory of converting basic trade data to OHLC (or Open, High, Low, Close) and apply it to generating 1 minute OHLC? Beside that, I also have problem adapting epoch timestamp to ISODate with the provided code.
var data = [{
"tid": 283945,
"date": 2018-08-02T04:24:53Z,
"amount": "0.08180000",
"price": "501.30"
}, {
"tid": 283947,
"date": 2018-08-02T04:24:53Z,
"amount": "0.06110000",
"price": "490.66"
},
...
];
function convertToOHLC(data) {
// What goes here?
}
convertToOHLC(data);
Here is the fiddle for previous code: https://jsfiddle.net/5dfjhnLw/
I created an example, according to your requirements how to convert data to ohlc:
Live demo: https://jsfiddle.net/BlackLabel/qwvrgy93/