You can define start dates and end dates not dependant on dependencies

This commit is contained in:
Luis Fernando Molina committed 2019-03-18 15:43:29 +01:00
1 parent 4a54b31422
commit d0a7f15c07
3 files changed
+133 -74

No files matched your search

+27 -1
View File
@@ -23,6 +23,8 @@
let usertBot;
let processConfig;
return thisObject;
function initialize(pProcessConfig, pStatusDependencies, pDataDependencies, callBackFunction) {
@@ -36,6 +38,7 @@
statusDependencies = pStatusDependencies;
dataDependencies = pDataDependencies;
processConfig = pProcessConfig;
for (let i = 0; i < dataDependencies.config.length; i++) {
@@ -72,6 +75,29 @@
let market = global.MARKET;
/* Context Variables */
let contextVariables = {
dateBeginOfMarket: undefined, // Datetime of the first trade file in the whole market history.
dateEndOfMarket: undefined // Datetime of the last file available to be used as an input of this process.
};
if (processConfig.framework.startDate.fixedDate !== undefined) {
/* The starting date is fixed, we will start from there. */
contextVariables.dateBeginOfMarket = new Date(processConfig.framework.startDate.fixedDate);
}
if (processConfig.framework.endDate.fixedDate !== undefined) {
/* The ending date is fixed, we will end there. */
contextVariables.dateEndOfMarket = new Date(processConfig.framework.endDate.fixedDate);
}
processTimePeriods();
function processTimePeriods() {
@@ -218,7 +244,7 @@
const timePeriod = global.marketFilesPeriods[n][0];
const outputPeriodLabel = global.marketFilesPeriods[n][1];
usertBot.start(dataFiles, timePeriod, outputPeriodLabel, onBotFinished);
usertBot.start(dataFiles, timePeriod, outputPeriodLabel, contextVariables.dateBeginOfMarket, contextVariables.dateEndOfMarket, onBotFinished);
function onBotFinished(err) {