From 9b1a54999acb4a0e425c2b8b0c340dec78899876 Mon Sep 17 00:00:00 2001 From: Smidy13 <77650800+Smidy13@users.noreply.github.com> Date: Sun, 12 Sep 2021 20:51:13 +1200 Subject: [PATCH] Bug Fix: Fast Forward in the Future --- .../Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js | 5 +++++ 1 file changed, 5 insertions(+) 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) :