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 9feb26e82..a1f6f0253 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 @@ -418,18 +418,21 @@ await exchange.fetchOHLCV(symbol, '1m', since, limit, params) - if (OHLCVs.length === 0) { + if (OHLCVs.length === 0 && new Date(since).valueOf() !== (new Date).setSeconds(0,0)) { + /* - If OHLCVs is empty we might be dealing with extended maintenance longer than our OHLCV limit. + If OHLCVs is empty and we're not at the current minute we might + be dealing with extended maintenance longer than our OHLCV limit. If this is the case jump forward to the next valid OHLCV record. */ + since = await findNextValidOHLCV() } /* CCXT for certain Exchanges will return an empty or partial array if the since date is too far in the past if this occurs this function will recursively step backwards in the Exchange - and Market in 1D intervals until it finds the earliest date with values. + and Market in 1D intervals until it finds the earliest date with values. */ async function findMarketStart() {