Data Dependencies upgraded to be UI based
This commit is contained in:
1 parent
dfaa8a9c51
commit
18323d526d
7 files changed
+141
-65
No files matched your search
+19
-5
@@ -2,9 +2,10 @@
|
||||
|
||||
const FULL_LOG = true;
|
||||
const LOG_FILE_CONTENT = false;
|
||||
|
||||
const MODULE_NAME = "Data Dependencies";
|
||||
|
||||
let bot = BOT
|
||||
|
||||
let thisObject = {
|
||||
nodeArray: undefined,
|
||||
dataSets: new Map(),
|
||||
@@ -15,15 +16,28 @@
|
||||
|
||||
return thisObject;
|
||||
|
||||
function initialize(pDataDependenciesConfig, callBackFunction) {
|
||||
function initialize(callBackFunction) {
|
||||
|
||||
try {
|
||||
|
||||
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] initialize -> Entering function."); }
|
||||
|
||||
thisObject.nodeArray = pDataDependenciesConfig;
|
||||
/* Basic Valdidations */
|
||||
if (bot.processNode.referenceParent.processDependencies !== undefined) {
|
||||
if (bot.processNode.referenceParent.processDependencies.dataDependencies !== undefined) {
|
||||
thisObject.nodeArray = bot.processNode.referenceParent.processDependencies.dataDependencies
|
||||
} else {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> onInitilized -> It is not possible to not have data dependencies at all.");
|
||||
callBackFunction(global.DEFAULT_OK_RESPONSE)
|
||||
return
|
||||
}
|
||||
} 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)
|
||||
return
|
||||
}
|
||||
|
||||
if (thisObject.nodeArray === undefined) {
|
||||
if (thisObject.nodeArray.length === 0) {
|
||||
|
||||
// We allow old indicators not to declare their data dependencies.
|
||||
|
||||
@@ -32,7 +46,7 @@
|
||||
}
|
||||
/*
|
||||
|
||||
For each dependency declared at the bot nodeArray, we will initialize a DataSet as part of this initialization process.
|
||||
For each dependency declared at the nodeArray, we will initialize a DataSet as part of this initialization process.
|
||||
|
||||
*/
|
||||
let alreadyCalledBack = false;
|
||||
|
||||
+71
-11
@@ -1,6 +1,6 @@
|
||||
exports.newDataSet = function newDataSet(BOT, logger) {
|
||||
|
||||
const MODULE_NAME = "Data Set";
|
||||
const MODULE_NAME = "Dataset";
|
||||
|
||||
let bot = BOT;
|
||||
|
||||
@@ -10,7 +10,7 @@ exports.newDataSet = function newDataSet(BOT, logger) {
|
||||
createTextFile: createTextFile
|
||||
};
|
||||
|
||||
let dependencyConfig;
|
||||
let dataDependencyNode;
|
||||
|
||||
/* Storage account to be used here. */
|
||||
|
||||
@@ -19,16 +19,76 @@ exports.newDataSet = function newDataSet(BOT, logger) {
|
||||
|
||||
return thisObject;
|
||||
|
||||
function initialize(pDependencyConfig, callBackFunction) {
|
||||
function initialize(pDataDependencyNode, callBackFunction) {
|
||||
|
||||
try {
|
||||
|
||||
|
||||
if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] initialize -> Entering function."); }
|
||||
|
||||
logger.fileName = MODULE_NAME + "." + pDependencyConfig.bot + "." + pDependencyConfig.product + "." + pDependencyConfig.dataSet;
|
||||
dataDependencyNode = pDataDependencyNode;
|
||||
logger.fileName = MODULE_NAME + "." + dataDependencyNode.type + "." + dataDependencyNode.name + "." + dataDependencyNode.id;
|
||||
|
||||
dependencyConfig = pDependencyConfig;
|
||||
/* Some very basic validations that we have all the information needed. */
|
||||
if (dataDependencyNode.referenceParent === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Data Dependency without Reference Parent. Data Dependency = " + JSON.stringify(dataDependencyNode));
|
||||
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
|
||||
return
|
||||
}
|
||||
|
||||
if (dataDependencyNode.referenceParent.code.codeName === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Dataset witn no codeName defined. Product Dataset = " + JSON.stringify(dataDependencyNode.referenceParent));
|
||||
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
|
||||
return
|
||||
}
|
||||
|
||||
if (dataDependencyNode.referenceParent.parentNode === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Dataset not attached to a Product Definition. Dataset = " + JSON.stringify(dataDependencyNode.referenceParent));
|
||||
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
|
||||
return
|
||||
}
|
||||
|
||||
if (dataDependencyNode.referenceParent.parentNode.code.codeName === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Product Definition witn no codeName defined. Product Definition = " + JSON.stringify(dataDependencyNode.referenceParent.parentNode));
|
||||
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
|
||||
return
|
||||
}
|
||||
|
||||
if (dataDependencyNode.referenceParent.parentNode.parentNode === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Product Definition not attached to a Bot. Product Definition = " + JSON.stringify(dataDependencyNode.referenceParent.parentNode));
|
||||
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
|
||||
return
|
||||
}
|
||||
|
||||
if (dataDependencyNode.referenceParent.parentNode.parentNode.code.codeName === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Bot witn no codeName defined. Bot = " + JSON.stringify(dataDependencyNode.referenceParent.parentNode.parentNode));
|
||||
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
|
||||
return
|
||||
}
|
||||
|
||||
if (dataDependencyNode.referenceParent.parentNode.parentNode.parentNode === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Bot not attached to a Team. Bot = " + JSON.stringify(dataDependencyNode.referenceParent.parentNode.parentNode));
|
||||
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
|
||||
return
|
||||
}
|
||||
|
||||
if (dataDependencyNode.referenceParent.parentNode.parentNode.parentNode.code.codeName === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Team witn no codeName defined. Team = " + JSON.stringify(dataDependencyNode.referenceParent.parentNode.parentNode.parentNode));
|
||||
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
|
||||
return
|
||||
}
|
||||
|
||||
/* Simplifying the access to basic info */
|
||||
dataDependencyNode.dataSet = dataDependencyNode.referenceParent.code.codeName
|
||||
dataDependencyNode.product = dataDependencyNode.referenceParent.parentNode.code.codeName
|
||||
dataDependencyNode.bot = dataDependencyNode.referenceParent.parentNode.parentNode.code.codeName
|
||||
dataDependencyNode.devTeam = dataDependencyNode.referenceParent.parentNode.parentNode.parentNode.code.codeName
|
||||
|
||||
/* This stuff is still hardcoded and unresolved. */
|
||||
dataDependencyNode.botVersion = {
|
||||
"major": 1,
|
||||
"minor": 0
|
||||
}
|
||||
dataDependencyNode.dataSetVersion = "dataSet.V1"
|
||||
|
||||
callBackFunction(global.DEFAULT_OK_RESPONSE);
|
||||
|
||||
@@ -44,11 +104,11 @@ exports.newDataSet = function newDataSet(BOT, logger) {
|
||||
|
||||
if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] getTextFile -> Entering function."); }
|
||||
|
||||
let filePathRoot = dependencyConfig.devTeam + "/" + dependencyConfig.bot + "." + dependencyConfig.botVersion.major + "." + dependencyConfig.botVersion.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + dependencyConfig.dataSetVersion;
|
||||
let filePathRoot = dataDependencyNode.devTeam + "/" + dataDependencyNode.bot + "." + dataDependencyNode.botVersion.major + "." + dataDependencyNode.botVersion.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + dataDependencyNode.dataSetVersion;
|
||||
let filePath = filePathRoot + "/Output/" + pFolderPath;
|
||||
filePath += '/' + pFileName
|
||||
|
||||
fileStorage.getTextFile(dependencyConfig.devTeam, filePath, onFileReceived);
|
||||
fileStorage.getTextFile(dataDependencyNode.devTeam, filePath, onFileReceived);
|
||||
|
||||
function onFileReceived(err, text) {
|
||||
|
||||
@@ -72,7 +132,7 @@ exports.newDataSet = function newDataSet(BOT, logger) {
|
||||
if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] createTextFile -> pFolderPath = " + pFolderPath); }
|
||||
if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] createTextFile -> pFileName = " + pFileName); }
|
||||
|
||||
let ownerId = dependencyConfig.devTeam + "-" + dependencyConfig.bot + "-" + dependencyConfig.botVersion.major + "-" + dependencyConfig.botVersion.minor + "-" + dependencyConfig.dataSetVersion;
|
||||
let ownerId = dataDependencyNode.devTeam + "-" + dataDependencyNode.bot + "-" + dataDependencyNode.botVersion.major + "-" + dataDependencyNode.botVersion.minor + "-" + dataDependencyNode.dataSetVersion;
|
||||
let botId = bot.devTeam + "-" + bot.codeName + "-" + bot.version.major + "-" + bot.version.minor + "-" + bot.dataSetVersion;
|
||||
|
||||
if (ownerId !== botId) {
|
||||
@@ -86,10 +146,10 @@ exports.newDataSet = function newDataSet(BOT, logger) {
|
||||
return;
|
||||
}
|
||||
|
||||
let filePathRoot = dependencyConfig.devTeam + "/" + dependencyConfig.bot + "." + dependencyConfig.botVersion.major + "." + dependencyConfig.botVersion.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + dependencyConfig.dataSetVersion;
|
||||
let filePathRoot = dataDependencyNode.devTeam + "/" + dataDependencyNode.bot + "." + dataDependencyNode.botVersion.major + "." + dataDependencyNode.botVersion.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + dataDependencyNode.dataSetVersion;
|
||||
let filePath = filePathRoot + "/Output/" + pFolderPath + '/' + pFileName;
|
||||
|
||||
fileStorage.createTextFile(dependencyConfig.devTeam, filePath, pFileContent, onFileCreated);
|
||||
fileStorage.createTextFile(dataDependencyNode.devTeam, filePath, pFileContent, onFileCreated);
|
||||
|
||||
function onFileCreated(err) {
|
||||
|
||||
|
||||
@@ -385,7 +385,7 @@
|
||||
|
||||
dataDependencies = DATA_DEPENDENCIES.newDataDependencies(bot, logger, DATA_SET);
|
||||
|
||||
dataDependencies.initialize(processConfig.dataDependencies, onInizialized);
|
||||
dataDependencies.initialize(onInizialized);
|
||||
|
||||
function onInizialized(err) {
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
logContent: false,
|
||||
intensiveLogging: false
|
||||
},
|
||||
"Data Set": {
|
||||
"Dataset": {
|
||||
logInfo: true,
|
||||
logWarnings: false,
|
||||
logErrors: true,
|
||||
|
||||
+47
-45
@@ -22,7 +22,7 @@
|
||||
verifyMarketComplete: verifyMarketComplete
|
||||
};
|
||||
|
||||
let owner; // This is the bot owner of the Status Report. Only owners can save the report and override the existing content.
|
||||
let statusDependencyNode;
|
||||
|
||||
/* Utilities needed. */
|
||||
|
||||
@@ -40,97 +40,99 @@
|
||||
|
||||
return thisObject;
|
||||
|
||||
function initialize(pOwner, pMonth, pYear, callBackFunction) {
|
||||
function initialize(pStatusDependencyNode, pMonth, pYear, callBackFunction) {
|
||||
|
||||
try {
|
||||
if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] initialize -> Entering function."); }
|
||||
|
||||
owner = pOwner;
|
||||
statusDependencyNode = pStatusDependencyNode;
|
||||
logger.fileName = MODULE_NAME + "." + statusDependencyNode.type + "." + statusDependencyNode.name + "." + statusDependencyNode.id;
|
||||
|
||||
month = pMonth;
|
||||
year = pYear;
|
||||
|
||||
/* Some very basic validations that we have all the information needed. */
|
||||
if (owner.referenceParent === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Status Dependency without Reference Parent. Status Dependency = " + JSON.stringify(owner));
|
||||
if (statusDependencyNode.referenceParent === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Status Dependency without Reference Parent. Status Dependency = " + JSON.stringify(statusDependencyNode));
|
||||
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
|
||||
return
|
||||
}
|
||||
|
||||
if (owner.referenceParent.parentNode === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Status Report not attached to a Process Definition. Status Report = " + JSON.stringify(owner.referenceParent));
|
||||
if (statusDependencyNode.referenceParent.parentNode === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Status Report not attached to a Process Definition. Status Report = " + JSON.stringify(statusDependencyNode.referenceParent));
|
||||
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
|
||||
return
|
||||
}
|
||||
|
||||
if (owner.referenceParent.parentNode.code.codeName === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Process Definition witn no codeName defined. Process Definition = " + JSON.stringify(owner.referenceParent.parentNode));
|
||||
if (statusDependencyNode.referenceParent.parentNode.code.codeName === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Process Definition witn no codeName defined. Process Definition = " + JSON.stringify(statusDependencyNode.referenceParent.parentNode));
|
||||
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
|
||||
return
|
||||
}
|
||||
|
||||
if (owner.referenceParent.parentNode.parentNode === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Process Definition not attached to a Bot. Process Definition = " + JSON.stringify(owner.referenceParent.parentNode));
|
||||
if (statusDependencyNode.referenceParent.parentNode.parentNode === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Process Definition not attached to a Bot. Process Definition = " + JSON.stringify(statusDependencyNode.referenceParent.parentNode));
|
||||
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
|
||||
return
|
||||
}
|
||||
|
||||
if (owner.referenceParent.parentNode.parentNode.code.codeName === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Bot witn no codeName defined. Bot = " + JSON.stringify(owner.referenceParent.parentNode.parentNode));
|
||||
if (statusDependencyNode.referenceParent.parentNode.parentNode.code.codeName === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Bot witn no codeName defined. Bot = " + JSON.stringify(statusDependencyNode.referenceParent.parentNode.parentNode));
|
||||
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
|
||||
return
|
||||
}
|
||||
|
||||
if (owner.referenceParent.parentNode.parentNode.parentNode === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Bot not attached to a Team. Bot = " + JSON.stringify(owner.referenceParent.parentNode.parentNode));
|
||||
if (statusDependencyNode.referenceParent.parentNode.parentNode.parentNode === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Bot not attached to a Team. Bot = " + JSON.stringify(statusDependencyNode.referenceParent.parentNode.parentNode));
|
||||
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
|
||||
return
|
||||
}
|
||||
|
||||
if (owner.referenceParent.parentNode.parentNode.parentNode.code.codeName === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Team witn no codeName defined. Team = " + JSON.stringify(owner.referenceParent.parentNode.parentNode.parentNode));
|
||||
if (statusDependencyNode.referenceParent.parentNode.parentNode.parentNode.code.codeName === undefined) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> Team witn no codeName defined. Team = " + JSON.stringify(statusDependencyNode.referenceParent.parentNode.parentNode.parentNode));
|
||||
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
|
||||
return
|
||||
}
|
||||
|
||||
/* Simplifying the access to basic info */
|
||||
owner.bot = owner.referenceParent.parentNode.parentNode.code.codeName
|
||||
owner.process = owner.referenceParent.parentNode.code.codeName
|
||||
owner.type = owner.referenceParent.parentNode.parentNode.type
|
||||
owner.devTeam = owner.referenceParent.parentNode.parentNode.parentNode.code.codeName
|
||||
statusDependencyNode.bot = statusDependencyNode.referenceParent.parentNode.parentNode.code.codeName
|
||||
statusDependencyNode.process = statusDependencyNode.referenceParent.parentNode.code.codeName
|
||||
statusDependencyNode.type = statusDependencyNode.referenceParent.parentNode.parentNode.type
|
||||
statusDependencyNode.devTeam = statusDependencyNode.referenceParent.parentNode.parentNode.parentNode.code.codeName
|
||||
|
||||
/* Let's see if the process is run monthly or not. */
|
||||
if (owner.referenceParent.parentNode.code.startMode !== undefined) {
|
||||
if (owner.referenceParent.parentNode.code.startMode.allMonths !== undefined) {
|
||||
if (owner.referenceParent.parentNode.code.startMode.oneMonth !== undefined) {
|
||||
if (owner.referenceParent.parentNode.code.startMode.allMonths.run === "true" || owner.referenceParent.parentNode.code.startMode.oneMonth.run === "true") {
|
||||
owner.processRunMonthly = true
|
||||
if (statusDependencyNode.referenceParent.parentNode.code.startMode !== undefined) {
|
||||
if (statusDependencyNode.referenceParent.parentNode.code.startMode.allMonths !== undefined) {
|
||||
if (statusDependencyNode.referenceParent.parentNode.code.startMode.oneMonth !== undefined) {
|
||||
if (statusDependencyNode.referenceParent.parentNode.code.startMode.allMonths.run === "true" || statusDependencyNode.referenceParent.parentNode.code.startMode.oneMonth.run === "true") {
|
||||
statusDependencyNode.processRunMonthly = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* We retrieve the report main utility */
|
||||
if (owner.code !== undefined) {
|
||||
if (owner.code.mainUtility !== undefined) {
|
||||
thisObject.mainUtility = owner.code.mainUtility
|
||||
if (statusDependencyNode.code !== undefined) {
|
||||
if (statusDependencyNode.code.mainUtility !== undefined) {
|
||||
thisObject.mainUtility = statusDependencyNode.code.mainUtility
|
||||
}
|
||||
}
|
||||
|
||||
/* This stuff is still hardcoded and unresolved. */
|
||||
owner.botVersion = {
|
||||
statusDependencyNode.botVersion = {
|
||||
"major": 1,
|
||||
"minor": 0
|
||||
}
|
||||
owner.dataSetVersion = "dataSet.V1"
|
||||
statusDependencyNode.dataSetVersion = "dataSet.V1"
|
||||
|
||||
logger.fileName = MODULE_NAME + "." + owner.bot + "." + owner.process;
|
||||
|
||||
if (bot.SESSION !== undefined && owner.type === "Trading Bot Instance") {
|
||||
|
||||
if (bot.SESSION !== undefined && statusDependencyNode.type === "Trading Bot Instance") {
|
||||
sessionPath = bot.SESSION.folderName + "/"
|
||||
}
|
||||
|
||||
if (owner.processRunMonthly === true) {
|
||||
logger.fileName = MODULE_NAME + "." + owner.bot + "." + owner.process + "." + year + "." + month;
|
||||
if (statusDependencyNode.processRunMonthly === true) {
|
||||
logger.fileName = MODULE_NAME + "." + statusDependencyNode.bot + "." + statusDependencyNode.process + "." + year + "." + month;
|
||||
timePath = "/" + year + "/" + month;
|
||||
}
|
||||
|
||||
@@ -151,23 +153,23 @@
|
||||
let fileName = "Status.Report." + global.MARKET.assetA + '_' + global.MARKET.assetB + ".json";
|
||||
let filePath;
|
||||
|
||||
let ownerId = owner.devTeam + "-" + owner.bot + "-" + owner.botVersion.major + "-" + owner.botVersion.minor + "-" + owner.process + "-" + owner.dataSetVersion;
|
||||
let ownerId = statusDependencyNode.devTeam + "-" + statusDependencyNode.bot + "-" + statusDependencyNode.botVersion.major + "-" + statusDependencyNode.botVersion.minor + "-" + statusDependencyNode.process + "-" + statusDependencyNode.dataSetVersion;
|
||||
let botId = bot.devTeam + "-" + bot.codeName + "-" + bot.version.major + "-" + bot.version.minor + "-" + bot.process + "-" + bot.dataSetVersion;
|
||||
|
||||
if (ownerId !== botId) {
|
||||
let rootPath = owner.devTeam + "/" + owner.bot + "." + owner.botVersion.major + "." + owner.botVersion.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + owner.dataSetVersion;
|
||||
filePath = rootPath + "/Reports/" + sessionPath + owner.process + timePath;
|
||||
let rootPath = statusDependencyNode.devTeam + "/" + statusDependencyNode.bot + "." + statusDependencyNode.botVersion.major + "." + statusDependencyNode.botVersion.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + statusDependencyNode.dataSetVersion;
|
||||
filePath = rootPath + "/Reports/" + sessionPath + statusDependencyNode.process + timePath;
|
||||
} else {
|
||||
filePath = bot.filePathRoot + "/Reports/" + sessionPath + owner.process + timePath;
|
||||
filePath = bot.filePathRoot + "/Reports/" + sessionPath + statusDependencyNode.process + timePath;
|
||||
}
|
||||
|
||||
if (owner.type === 'Trading') {
|
||||
if (statusDependencyNode.type === 'Trading') {
|
||||
fileName = bot.startMode + "." + fileName;
|
||||
}
|
||||
|
||||
filePath += '/' + fileName
|
||||
|
||||
fileStorage.getTextFile(owner.devTeam, filePath, onFileReceived);
|
||||
fileStorage.getTextFile(statusDependencyNode.devTeam, filePath, onFileReceived);
|
||||
|
||||
function onFileReceived(err, text) {
|
||||
|
||||
@@ -235,10 +237,10 @@
|
||||
|
||||
if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] save -> Entering function."); }
|
||||
|
||||
let ownerId = owner.devTeam + "-" + owner.bot + "-" + owner.botVersion.major + "-" + owner.botVersion.minor + "-" + owner.process + "-" + owner.dataSetVersion;
|
||||
let ownerId = statusDependencyNode.devTeam + "-" + statusDependencyNode.bot + "-" + statusDependencyNode.botVersion.major + "-" + statusDependencyNode.botVersion.minor + "-" + statusDependencyNode.process + "-" + statusDependencyNode.dataSetVersion;
|
||||
let botId = bot.devTeam + "-" + bot.codeName + "-" + bot.version.major + "-" + bot.version.minor + "-" + bot.process + "-" + bot.dataSetVersion;
|
||||
|
||||
if (ownerId !== botId && owner.process !== "Context") { // Context is a special case where the report is created by the Context.js module itself.
|
||||
if (ownerId !== botId && statusDependencyNode.process !== "Context") { // Context is a special case where the report is created by the Context.js module itself.
|
||||
|
||||
let customErr = {
|
||||
result: global.CUSTOM_FAIL_RESPONSE.result,
|
||||
@@ -250,7 +252,7 @@
|
||||
}
|
||||
|
||||
let fileName = "Status.Report." + global.MARKET.assetA + '_' + global.MARKET.assetB + ".json";
|
||||
let filePath = bot.filePathRoot + "/Reports/" + sessionPath + owner.process + timePath;
|
||||
let filePath = bot.filePathRoot + "/Reports/" + sessionPath + statusDependencyNode.process + timePath;
|
||||
|
||||
if (bot.type === 'Trading' ) {
|
||||
fileName = bot.startMode + "." + fileName;
|
||||
@@ -259,7 +261,7 @@
|
||||
filePath += '/' + fileName
|
||||
let fileContent = JSON.stringify(thisObject.file);
|
||||
|
||||
fileStorage.createTextFile(owner.devTeam, filePath, fileContent + '\n', onFileCreated);
|
||||
fileStorage.createTextFile(statusDependencyNode.devTeam, filePath, fileContent + '\n', onFileCreated);
|
||||
|
||||
function onFileCreated(err) {
|
||||
|
||||
|
||||
@@ -420,7 +420,7 @@
|
||||
|
||||
dataDependencies = DATA_DEPENDENCIES.newDataDependencies(bot, logger, DATA_SET);
|
||||
|
||||
dataDependencies.initialize(processConfig.dataDependencies, onInizialized);
|
||||
dataDependencies.initialize(onInizialized);
|
||||
|
||||
function onInizialized(err) {
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ if (global.TASK_NODE !== undefined) {
|
||||
}
|
||||
else { // I use this section to debug in standalone mode.
|
||||
let argument
|
||||
argument = '{"type":"Task","name":"Generates 1 min to 24 hs Candles & Volumes","bot":{"type":"Indicator Bot Instance","name":"Olivia","code":{"team":"AAMasters","bot":"AAOlivia","repo":"AAOlivia-Indicator-Bot"},"processes":[{"type":"Process Instance","subType":"Indicator Process Instance","name":"Daily","code":{"process":"Multi-Period-Daily"},"id":"050d715f-2851-48b4-86b6-d93ab4baa1b2","referenceParent":{"type":"Process Definition","name":"Multi-Period-Daily","code":{"codeName":"Multi-Period-Daily","description":"Produces different files with multi-period candles and volumes on a daily format.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"true"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"5c56f87a-e3b2-46fc-8e4e-f40c0dacabb5","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[{"type":"Output Dataset","name":"New Output Dataset","id":"f349a029-5381-4f8e-92d4-1b7e7df76966","referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","code":{"codeName":"Multi-Period-Daily"},"parentNode":{"type":"Product Definition","name":"Candles","code":{"codeName":"Candles"},"datasets":[],"parentNode":{"type":"Indicator Bot","name":"Olivia","code":{"codeName":"AAOlivia"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"30d6289c-4f5c-471e-9d6d-93bfd5453781"},"id":"36ae2d5d-6734-4526-b2f8-31c89a0c4fc1"},"id":"742ab33f-d382-4a40-ab03-42e4f1916cc2"}},{"type":"Output Dataset","name":"New Output Dataset","id":"15fd40ad-ceca-46ea-8fdd-4a396f9bde14","referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","code":{"codeName":"Multi-Period-Daily"},"parentNode":{"type":"Product Definition","name":"Volumes","code":{"codeName":"Volumes"},"datasets":[],"parentNode":{"type":"Indicator Bot","name":"Olivia","code":{"codeName":"AAOlivia"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"30d6289c-4f5c-471e-9d6d-93bfd5453781"},"id":"b2d5ba69-67ac-490f-9e74-28239b35a92e"},"id":"404b8d12-db14-462c-b4e4-6ee5093560c3"}}],"id":"e130a389-0b18-4433-809d-f44162a00a4a"},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"Market Starting Point","code":{"mainUtility":"Market Starting Point"},"id":"93f6d813-594f-49cd-a32f-181a7b8352ee","referenceParent":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Historic-Trades","code":{"codeName":"Historic-Trades","description":"Retrieves and saves the historical trades in batches going backwards from the current time until reaching the begining of the market.","startMode":{"allMonths":{"run":"false","minYear":"2014","maxYear":"2020"},"oneMonth":{"run":"false","year":"2018","month":"01"},"noTime":{"run":"false"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":60000,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"e2c3f7c3-b74c-4145-8a60-f73cc3364629","parentNode":{"type":"Sensor Bot","name":"Charly","code":{"codeName":"AACharly"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"957bef47-cd90-4dfa-bbb1-3696c527b010"}},"id":"c542a73e-a350-431f-ad3e-10f3ebef8ec7"}},{"type":"Status Dependency","name":"Self Reference","code":{"mainUtility":"Self Reference"},"id":"cb413af9-e1f6-4dbe-ab8c-9f7eb949bd93","referenceParent":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Multi-Period-Daily","code":{"codeName":"Multi-Period-Daily","description":"Produces different files with multi-period candles and volumes on a daily format.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"true"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"5c56f87a-e3b2-46fc-8e4e-f40c0dacabb5","parentNode":{"type":"Indicator Bot","name":"Olivia","code":{"codeName":"AAOlivia"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"30d6289c-4f5c-471e-9d6d-93bfd545378Line truncated
|
||||
argument = '{"type":"Task","name":"Generates Bollinger Channels & Sub-Channels","bot":{"type":"Indicator Bot Instance","name":"Paula","code":{"team":"AAMasters","bot":"AAPaula","repo":"AAChris-Indicator-Bot"},"processes":[{"type":"Process Instance","subType":"Indicator Process Instance","name":"Market","code":{"process":"Multi-Period-Market"},"id":"6ddd81e2-d6db-4814-9c6c-96538a74824c","referenceParent":{"type":"Process Definition","name":"Multi-Period-Market","code":{"codeName":"Multi-Period-Market","description":"Produces for each market two files with bollinger channels respectively.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"true"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000,"framework":{"name":"Multi-Period-Market","startDate":{},"endDate":{}}},"id":"28be432d-80ca-46b3-859a-55541e24b2b4","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[{"type":"Output Dataset","name":"Bollinger Channels","id":"d804e799-7c12-42f5-8de2-52a3a7d5daa4","referenceParent":{"type":"Dataset Definition","name":"Market","code":{"codeName":"Multi-Period-Market","type":"Market Files","validPeriods":["24-hs","12-hs","08-hs","06-hs","04-hs","03-hs","02-hs","01-hs"],"filePath":"AAMasters/AAPaula.1.0/AACloud.1.1/@Exchange/dataSet.V1/Output/Bollinger-Channels/Multi-Period-Market/@Period","fileName":"@AssetA_@AssetB.json"},"parentNode":{"type":"Product Definition","name":"Bollinger Channels","code":{"codeName":"Bollinger-Channels","displayName":"Bollinger-Channels","description":"Two sets of files per period that contains Bollinger-Bands-Channels-Patterns.","shareWith":"Public"},"datasets":[],"parentNode":{"type":"Indicator Bot","name":"Paula","code":{"codeName":"AAPaula"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"bd0f325d-6f98-468b-8b7b-99a42a175d80"},"id":"1f111f72-624f-4166-9f99-ab8d785d5267"},"id":"610cd062-ab88-4892-b711-0fb430305c61"}},{"type":"Output Dataset","name":"Bollinger Standard Channels","id":"e524685d-8da0-41f6-839d-9a4100e6e3fe","referenceParent":{"type":"Dataset Definition","name":"Market","code":{"codeName":"Multi-Period-Market","type":"Market Files","validPeriods":["24-hs","12-hs","08-hs","06-hs","04-hs","03-hs","02-hs","01-hs"],"filePath":"AAMasters/AAPaula.1.0/AACloud.1.1/@Exchange/dataSet.V1/Output/Bollinger-Standard-Channels/Multi-Period-Market/@Period","fileName":"@AssetA_@AssetB.json"},"parentNode":{"type":"Product Definition","name":"Bollinger Standard Channels","code":{"codeName":"Bollinger-Standard-Channels","displayName":"Bollinger-Standard-Channels","description":"","shareWith":"Public"},"datasets":[],"parentNode":{"type":"Indicator Bot","name":"Paula","code":{"codeName":"AAPaula"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"bd0f325d-6f98-468b-8b7b-99a42a175d80"},"id":"94bc3958-cc85-43a1-a178-103e84f42910"},"id":"22c1f2c6-3838-4657-add8-2e01d7056917"}},{"type":"Output Dataset","name":"Bollinger Sub-Channels","id":"eb0e7947-95e4-4f4a-87ea-1fb430b8b503","referenceParent":{"type":"Dataset Definition","name":"Market","code":{"codeName":"Multi-Period-Market","type":"Market Files","validPeriods":["24-hs","12-hs","08-hs","06-hs","04-hs","03-hs","02-hs","01-hs"],"filePath":"AAMasters/AAPaula.1.0/AACloud.1.1/@Exchange/dataSet.V1/Output/Bollinger-Sub-Channels/Multi-Period-Market/@Period","fileName":"@AssetA_@AssetB.json"},"parentNode":{"type":"Product Definition","name":"Bollinger Sub-Channels","code":{"codeName":"Bollinger-Sub-Channels","displayName":"Bollinger-Sub-Channels","description":"Bollinger Sub Channels with slope.","shareWith":"Public"},"datasets":[],"parentNode":{"type":"Indicator Bot","name":"Paula","code":{"codeName":"AAPaula"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"bd0f325d-6f98-468b-8b7b-99a42a175d80"},"id":"080c87fc-4546-4482-ab11-180a33f6d9ab"},"id":"869f615e-0cc0-44fd-8648-4a951c23a410"}},{"type":"Output Dataset","name":"Bollinger Standard Sub-Channels","id":"dc96b9ac-f8d5-4bf8-a135-45cd5d6369f1","referenceParent":{"type":"Dataset Definition","name":"Market","code":{"codeName":"Multi-Period-Market","type":"Market Files","validPeriods":["24-hs","12-hs","08-hs","06-hs","04-hs","03-hs","02-hs","01-hs"],"filePath":"AAMasters/AAPaula.1.0/AACloud.1.1/@Exchange/dataSet.V1/Output/Bollinger-Standard-Sub-Channels/Multi-Period-Market/@PeriLine truncated
|
||||
|
||||
try {
|
||||
global.TASK_NODE = JSON.parse(argument)
|
||||
|
||||
Reference in new issue
Block a user