diff --git a/request-processor.js b/request-processor.js index d154c79..f60a7f8 100644 --- a/request-processor.js +++ b/request-processor.js @@ -242,7 +242,7 @@ function filterDataPeriod(data, fromSeconds, toSeconds) { s = 'no_data'; } - toIndex = Math.min(fromIndex + 1000, toIndex); // do not send more than 1000 bars for server capacity reasons + fromIndex = Math.max(fromIndex, toIndex - 1000); // do not send more than 1000 bars for server capacity reasons return { t: data.t.slice(fromIndex, toIndex),