Fix crex24 market chart
-Chart data was pulling the last 100 trades within 15m intervals but was often returning data well beyond the 24h time period and could lead to some unreadable/unusable charts
This commit is contained in:
+5
-2
@@ -104,8 +104,11 @@ function get_chartdata(coin, exchange, cb) {
|
||||
else {
|
||||
var processed = [];
|
||||
|
||||
for (var i = 0; i < chartdata.length; i++)
|
||||
processed.push([new Date(chartdata[i].timestamp).getTime(), parseFloat(chartdata[i].open), parseFloat(chartdata[i].high), parseFloat(chartdata[i].low), parseFloat(chartdata[i].close)]);
|
||||
for (var i = 0; i < chartdata.length; i++) {
|
||||
// only keep values from within the last 24 hours
|
||||
if (new Date(chartdata[i].timestamp).getTime()/1000 > start)
|
||||
processed.push([new Date(chartdata[i].timestamp).getTime(), parseFloat(chartdata[i].open), parseFloat(chartdata[i].high), parseFloat(chartdata[i].low), parseFloat(chartdata[i].close)]);
|
||||
}
|
||||
|
||||
return cb(null, processed);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user