diff --git a/Projects/Foundations/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js b/Projects/Foundations/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js index a1f6f0253..08525fa48 100644 --- a/Projects/Foundations/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js +++ b/Projects/Foundations/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js @@ -494,6 +494,11 @@ while (foundDate !== true) { + /* If we are in the future then return the current (blank) array */ + if (new Date(since) <= new Date) { + return OHLCVs + } + await new Promise(resolve => setTimeout(resolve, rateLimit)) // rate limit const nextValidOHLCVs = useFetchTradesForFetchOHLCVs ? await fetchTradesForOHLCV(symbol, '1m', since, limit, params) :