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 1/2] 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) : From 2a6515b2afec92f03f2b48979a002619973561f5 Mon Sep 17 00:00:00 2001 From: Smidy13 <77650800+Smidy13@users.noreply.github.com> Date: Sun, 12 Sep 2021 21:00:27 +1200 Subject: [PATCH 2/2] Bug Fix: Fast Forward into the Future --- .../Bot-Modules/Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 08525fa48..0e8fb55fc 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,8 +494,7 @@ while (foundDate !== true) { - /* If we are in the future then return the current (blank) array */ - if (new Date(since) <= new Date) { + if (new Date(since).valueOf() >= (new Date).setSeconds(0,0)) { return OHLCVs }