Includes Implemented

This commit is contained in:
Luis Fernando Molina committed 2020-09-21 10:19:50 +02:00
1 parent c77b9af992
commit e494dd8ad9
31 files changed
+681 -217

No files matched your search

+7 -3
View File
@@ -28,6 +28,13 @@
callBackFunction(global.DEFAULT_OK_RESPONSE)
return
}
/*
We will filter ourt declared dependencies that are not present in the workspace.
This will allow the user to have less Data Mines loaded at the workspace
that the ones that a Trading Mine depends on.
*/
thisObject.nodeArray = global.FILTER_OUT_NODES_WITHOUT_REFERENCE_PARENT_FROM_NODE_ARRAY(thisObject.nodeArray)
} else {
logger.write(MODULE_NAME, "[ERROR] initialize -> onInitilized -> It is not possible to not have process dependencies, which means not data dependencies.");
callBackFunction(global.DEFAULT_OK_RESPONSE)
@@ -57,9 +64,7 @@
let addCount = 0;
for (let i = 0; i < thisObject.nodeArray.length; i++) {
let dataSetModule = DATA_SET.newDataSet(BOT, logger);
dataSetModule.initialize(thisObject.nodeArray[i], onInitilized);
function onInitilized(err) {
@@ -71,7 +76,6 @@
callBackFunction(err);
return;
}
addDataSet();
}
@@ -505,6 +505,12 @@
/* The first phase here is about checking that we have everything we need at the definition level. */
let dataDependencies = global.NODE_BRANCH_TO_ARRAY(bot.processNode.referenceParent.processDependencies, 'Data Dependency')
/*
We will filter ourt declared dependencies that are not present in the workspace.
This will allow the user to have less Data Mines loaded at the workspace
that the ones that a Trading Mine depends on.
*/
dataDependencies = global.FILTER_OUT_NODES_WITHOUT_REFERENCE_PARENT_FROM_NODE_ARRAY(dataDependencies)
if (commons.validateDataDependencies(dataDependencies, callBackFunction) !== true) { return }
@@ -317,6 +317,7 @@ exports.newTradingSimulation = function newTradingSimulation(bot, logger, tradin
For that reason we do the following processing, to have at the chart data structure the current objects of each indicator / time frame.
*/
let dataDependencies = global.NODE_BRANCH_TO_ARRAY(bot.processNode.referenceParent.processDependencies, 'Data Dependency')
dataDependencies = global.FILTER_OUT_NODES_WITHOUT_REFERENCE_PARENT_FROM_NODE_ARRAY(dataDependencies)
/* Finding the Current Element on Market Files */
if (bot.processingDailyFiles) {
+13
View File
@@ -272,6 +272,19 @@ global.FIND_NODE_IN_NODE_ARRAY = function (nodeArray, nodeType) {
}
}
global.FILTER_OUT_NODES_WITHOUT_REFERENCE_PARENT_FROM_NODE_ARRAY = function (nodeArray) {
let filteredNodeArray = []
for (let i = 0; i < nodeArray.length; i++) {
let arrayItem = nodeArray[i]
if (arrayItem.referenceParent === undefined) {
continue
} else {
filteredNodeArray.push(arrayItem)
}
}
return filteredNodeArray
}
process.on('uncaughtException', function (err) {
console.log('[ERROR] Task Server -> server -> uncaughtException -> err.message = ' + err.message)