diff --git a/Projects/Data-Mining/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js b/Projects/Data-Mining/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js index 271580832..c3af1d26a 100644 --- a/Projects/Data-Mining/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js +++ b/Projects/Data-Mining/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js @@ -65,7 +65,7 @@ let exchangeClass /* This is what we are going to do hereL - + 1. Parameters set by SA user at the Crypto Exchange node are extracted. There might be parameters for each supported method at the CCXT library. 2. The CCXT class for the configured exchange is instantiated, with whatever options where configured. @@ -75,6 +75,12 @@ statusDependencies = pStatusDependencies; exchangeId = TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.codeName + /* + maxRate - sets the maximum number of OHCLV that is pulled before the data is saved. + This is only to be used when the exchange is kicking out the data-mine randomly and alows the user to + save the data more often allowing for the data mining to move forward. + */ + maxRate = TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.maxRate /* Applying the parameters defined by the user at the Exchange Node Config */ if (TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.API !== undefined) { @@ -578,6 +584,16 @@ let currentDate = new Date(since) + /* + maxRate - sets the maximum number of OHCLV that is pulled before the data is saved. + maxRate should only be used when the exchange is kicking out the data-mine randomly and alows the user to + save the data more often allowing for the data mining to move forward. + Check if we don't have a maxRate parameter and use global parameter instead + */ + if (!maxRate) { + maxRate = MAX_OHLCVs_PER_EXECUTION + } + /* If we've pulled less OHLCVs than the limit, this either means: (1) we reached the current date and are now pulling the latest