Convert data to OHLC (Open, High, Low, Close) in JavaScript?
Similar to create an OHLC data from Date, time, price using C# , how does one take the theory of converting basic trade data to OHLC (or Open, High, Low, Close) and apply it to this distinct case? var data = [{ "tid": 283945, "date": 1384934366, "amount": "0.08180000", "price": "501.30" }, { "tid": 283947, "date": 1384934066, "amount": "0.06110000", "price": "490.66" }, ... ]; function convertToOHLC(data) { // What goes here? } convertToOHLC(data); Here is the fiddle: https://jsfiddle.net/5dfjhnLw/ This is a working function for converting the data to OHLC: function convertToOHLC(data) { data