Merge pull request #461 from Luis-Fernando-Molina/develop

Contribution: Master Datamine cleaned of unused proeprty at Bollinger Band Indicator (repo)
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2021-01-25 11:53:34 +01:00
commit ca5e1c9d30
6 files changed
+217 -16

No files matched your search

+6
View File
@@ -462,6 +462,12 @@
"propertyName": "miscellaneousFunctions",
"functionName": "newSuperalgosUtilitiesMiscellaneousFunctions",
"fileName": "MiscellaneousFunctions.js"
},
{
"name": "Docs Functions",
"propertyName": "docsFunctions",
"functionName": "newSuperalgosUtilitiesDocsFunctions",
"fileName": "DocsFunctions.js"
}
],
"taskModules": [
@@ -1 +1 @@
{"type":"Data Mine","name":"Masters","config":"{\n\"codeName\": \"Masters\"\n}","project":"Superalgos","sensorBots":[{"type":"Sensor Bot","name":"Exchange Raw Data","config":"{\n\"codeName\": \"Exchange-Raw-Data\"\n}","project":"Superalgos","processes":[{"type":"Process Definition","name":"Historic-OHLCVs","config":"{\n \"codeName\": \"Historic-OHLCVs\",\n \"description\": \"Retrieves and saves historical maket data\",\n \"deadWaitTime\": 0,\n \"normalWaitTime\": 60000,\n \"retryWaitTime\": 10000,\n \"botModule\": \"Exchange Raw Data Historic OHLCVs\"\n}","project":"Superalgos","processOutput":{"type":"Process Output","name":"New Process Output","project":"Superalgos","outputDatasets":[],"outputDatasetFolders":[],"id":"dfe2556e-a765-4e38-9d30-7f91090c0069","savedPayload":{"position":{"x":7542.108005075513,"y":17855.768569069416},"targetPosition":{"x":7502.950147409498,"y":18153.20202748156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","project":"Superalgos","statusDependencies":[{"type":"Status Dependency","name":"Exchange Raw Data Historic-OHLCVs","config":"{\n \"mainUtility\": \"Self Reference\"\n}","project":"Superalgos","id":"ea39c98b-18e2-44ce-9f7f-86a8a76a688a","savedPayload":{"position":{"x":7868.207004814731,"y":17677.190023306815},"targetPosition":{"x":7685.578576112114,"y":17915.196025394187},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"181c7c34-7243-497a-9ddb-1b0067c6d66e"}}}],"dataDependencies":[],"dataMineDataDependencies":[],"id":"5c7fae5a-6da6-4864-a167-f2f21d578c72","savedPayload":{"position":{"x":7685.578576112114,"y":17915.196025394187},"targetPosition":{"x":7502.950147409498,"y":18153.20202748156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"statusReport":{"type":"Status Report","name":"New Status Report","project":"Superalgos","id":"181c7c34-7243-497a-9ddb-1b0067c6d66e","savedPayload":{"position":{"x":7780.114007162883,"y":18038.396997772034},"targetPosition":{"x":7502.950147409498,"y":18153.20202748156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"executionStartedEvent":{"type":"Execution Started Event","name":"","project":"Superalgos","id":"957e7e3a-b167-40be-93b5-9ba4ceff56e5","savedPayload":{"position":{"x":7800.383605821641,"y":18192.359885147573},"targetPosition":{"x":7502.950147409498,"y":18153.20202748156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"executionFinishedEvent":{"type":"Execution Finished Event","name":"New Execution Finished Event","project":"Superalgos","id":"fe40a546-43ee-49df-908a-7e72f598f0cd","savedPayload":{"position":{"x":7740.956149496868,"y":18335.830456184176},"targetPosition":{"x":7502.950147409498,"y":18153.20202748156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"5eb11d6a-022e-4f60-97c4-d6cf90b249dc","savedPayload":{"position":{"x":7502.950147409498,"y":18153.20202748156},"targetPosition":{"x":7225.786287656112,"y":18268.007057191084},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"products":[{"type":"Product Definition","name":"Candles","config":"{\n\"codeName\": \"Candles\"\n}","project":"Superalgos","datasets":[{"type":"Dataset Definition","name":"One-Min","config":"{\n\"codeName\": \"One-Min\"\n}","project":"Superalgos","id":"1c3696e4-c28e-4744-9100-706d6dce0c3c","savedPayload":{"position":{"x":7675.786287656112,"y":18268.007057191084},"targetPosition":{"x":7525.786287656112,"y":18268.007057191084},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"id":"2443883b-6959-42a3-ae3b-ef3102ffcdcc","savedPayload":{"position":{"x":7525.786287656112,"y":18268.007057191084},"targetPosition":{"x":7225.786287656112,"y":18268.007057191084},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Product Definition","name":"Volumes","config":"{\n\"codeName\": \"Volumes\"\n}","project":"Superalgos","datasets":[{"type":"Dataset Definition","name":"One-Min","config":"{\n\"codeName\": \"One-Min\"\n}","proLine truncated
{"type":"Data Mine","name":"Masters","config":"{\n\"codeName\": \"Masters\"\n}","project":"Superalgos","sensorBots":[{"type":"Sensor Bot","name":"Exchange Raw Data","config":"{\n\"codeName\": \"Exchange-Raw-Data\"\n}","project":"Superalgos","processes":[{"type":"Process Definition","name":"Historic-OHLCVs","config":"{\n \"codeName\": \"Historic-OHLCVs\",\n \"description\": \"Retrieves and saves historical maket data\",\n \"deadWaitTime\": 0,\n \"normalWaitTime\": 60000,\n \"retryWaitTime\": 10000,\n \"botModule\": \"Exchange Raw Data Historic OHLCVs\"\n}","project":"Superalgos","processOutput":{"type":"Process Output","name":"New Process Output","project":"Superalgos","outputDatasets":[],"outputDatasetFolders":[],"id":"dfe2556e-a765-4e38-9d30-7f91090c0069","savedPayload":{"position":{"x":19495.67390477555,"y":18276.314530096774},"targetPosition":{"x":19456.516047109537,"y":18573.747988508916},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","project":"Superalgos","statusDependencies":[{"type":"Status Dependency","name":"Exchange Raw Data Historic-OHLCVs","config":"{\n \"mainUtility\": \"Self Reference\"\n}","project":"Superalgos","id":"ea39c98b-18e2-44ce-9f7f-86a8a76a688a","savedPayload":{"position":{"x":19821.77290451477,"y":18097.735984334173},"targetPosition":{"x":19639.144475812154,"y":18335.741986421544},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"181c7c34-7243-497a-9ddb-1b0067c6d66e"}}}],"dataDependencies":[],"dataMineDataDependencies":[],"id":"5c7fae5a-6da6-4864-a167-f2f21d578c72","savedPayload":{"position":{"x":19639.144475812154,"y":18335.741986421544},"targetPosition":{"x":19456.516047109537,"y":18573.747988508916},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"statusReport":{"type":"Status Report","name":"New Status Report","project":"Superalgos","id":"181c7c34-7243-497a-9ddb-1b0067c6d66e","savedPayload":{"position":{"x":19733.679906862923,"y":18458.94295879939},"targetPosition":{"x":19456.516047109537,"y":18573.747988508916},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"executionStartedEvent":{"type":"Execution Started Event","name":"","project":"Superalgos","id":"957e7e3a-b167-40be-93b5-9ba4ceff56e5","savedPayload":{"position":{"x":19753.94950552168,"y":18612.90584617493},"targetPosition":{"x":19456.516047109537,"y":18573.747988508916},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"executionFinishedEvent":{"type":"Execution Finished Event","name":"New Execution Finished Event","project":"Superalgos","id":"fe40a546-43ee-49df-908a-7e72f598f0cd","savedPayload":{"position":{"x":19694.52204919691,"y":18756.376417211533},"targetPosition":{"x":19456.516047109537,"y":18573.747988508916},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"5eb11d6a-022e-4f60-97c4-d6cf90b249dc","savedPayload":{"position":{"x":19456.516047109537,"y":18573.747988508916},"targetPosition":{"x":19179.35218735615,"y":18688.55301821844},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"products":[{"type":"Product Definition","name":"Candles","config":"{\n\"codeName\": \"Candles\"\n}","project":"Superalgos","datasets":[{"type":"Dataset Definition","name":"One-Min","config":"{\n\"codeName\": \"One-Min\"\n}","project":"Superalgos","id":"1c3696e4-c28e-4744-9100-706d6dce0c3c","savedPayload":{"position":{"x":19629.35218735615,"y":18688.55301821844},"targetPosition":{"x":19479.35218735615,"y":18688.55301821844},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"id":"2443883b-6959-42a3-ae3b-ef3102ffcdcc","savedPayload":{"position":{"x":19479.35218735615,"y":18688.55301821844},"targetPosition":{"x":19179.35218735615,"y":18688.55301821844},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Product Definition","name":"Volumes","config":"{\n\"codeName\": \"Volumes\"\n}","project":"Superalgos","datasets":[{"type":"Dataset Definition","name":"One-Min","config":"{\n\"codeName\": \"One-Min\"\Line truncated
@@ -0,0 +1,133 @@
{
"topic": "TS LF Trading Bot Errors",
"pageNumber": "1",
"type": "TS LF Trading Bot Error - Evaluating Condition Error",
"definition": {
"text": "An error occured while evaluation a User Defined Condition at the Trading System.",
"updated": 1611568961215
},
"paragraphs": [
{
"style": "Text",
"text": "While running at the TS, the Low Frequency Trading Bot encounteren an error while trying to evaluate one of your conditions defined at the Trading System. Conditions are arbitrary Javascript Code that user can write as they want and in some cases they do not write valid Javascript for Nod JS. ",
"updated": 1611569329977
},
{
"style": "Error",
"text": "Evaluating Condition Error",
"updated": 1611569347664
},
{
"style": "Title",
"text": "Error Details"
},
{
"style": "Text",
"text": "In the following section you will find the specific information received when this error occured."
},
{
"style": "Success",
"text": "You will only see it if you opened this page as a result of the error actually happening.",
"updated": 1611569373599
},
{
"style": "Subtitle",
"text": "Error Message"
},
{
"style": "Text",
"text": "The following is the Error Message of the Exception that occured at the LF Trading Bot:",
"updated": 1611569424352
},
{
"style": "Placeholder",
"text": "errorMessage"
},
{
"style": "Subtitle",
"text": "Error Stack"
},
{
"style": "Text",
"text": "The following is the Error Stack of the Exception that occured at the LF Trading Bot:",
"updated": 1611569434043
},
{
"style": "Placeholder",
"text": "errorStack"
},
{
"style": "Subtitle",
"text": "Error Code"
},
{
"style": "Text",
"text": "The follwing is the Error Code of the Exception that occured at the LF Trading Bot:",
"updated": 1611569440715
},
{
"style": "Placeholder",
"text": "errorCode"
},
{
"style": "Subtitle",
"text": "Error Details"
},
{
"style": "Text",
"text": "The follwing are all the Error details of the Exception that occured at the LF Trading Bot:",
"updated": 1611569446711
},
{
"style": "Placeholder",
"text": "errorDetails"
},
{
"style": "Subtitle",
"text": "Node Name",
"updated": 1611571361685
},
{
"style": "Text",
"text": "The follwing is the node's name of the Node most related to this error:",
"updated": 1611571455498
},
{
"style": "Placeholder",
"text": "nodeName"
},
{
"style": "Subtitle",
"text": "Node Code"
},
{
"style": "Text",
"text": "The follwing is the code stored at the node that produced the error at the LF Trading Bot:",
"updated": 1611569545869
},
{
"style": "Placeholder",
"text": "nodeCode",
"updated": 1611569590234
},
{
"style": "Subtitle",
"text": "Node Config",
"updated": 1611569510340
},
{
"style": "Text",
"text": "The follwing is the config stored at the node that produced the error at the LF Trading Bot:",
"updated": 1611569573367
},
{
"style": "Placeholder",
"text": "nodeConfig",
"updated": 1611569598109
},
{
"style": "Text",
"text": ""
}
]
}
@@ -236,16 +236,19 @@ exports.newSuperalgosBotModulesTradingSystem = function (processIndex) {
function evalCondition(node) {
let value
let error
let errorMessage
let docs
/*
The code can be at the condition node if it was done with the Conditions Editor, or it can also be
at a Javascript Code node. If there is a Javascript object we will give it preference and take the code
from there. Otherwise we will take the code from the Condition node.
*/
let code = node.code
let nodeName = node.name
if (node.javascriptCode !== undefined) {
if (node.javascriptCode.code !== undefined) {
code = node.javascriptCode.code
nodeName = node.javascriptCode.name
}
}
@@ -258,7 +261,14 @@ exports.newSuperalgosBotModulesTradingSystem = function (processIndex) {
will not be considered an error.
*/
value = false
error = err.message
errorMessage = err.message
docs = {
project: 'Superalgos',
category: 'Topic',
type: 'TS LF Trading Bot Error - Evaluating Condition Error',
placeholder: {}
}
TS.projects.superalgos.utilities.docsFunctions.buildPlaceholder(docs, err, nodeName, code, undefined)
}
tradingSystem.conditions.set(node.id, value)
@@ -266,20 +276,20 @@ exports.newSuperalgosBotModulesTradingSystem = function (processIndex) {
if (value === true) {
tradingSystem.highlights.push(node.id)
}
if (error !== undefined) {
tradingSystem.errors.push([node.id, error])
if (errorMessage !== undefined) {
tradingSystem.errors.push([node.id, errorMessage, docs])
}
if (value !== undefined) {
tradingSystem.values.push([node.id, value])
}
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[INFO] evalCondition -> value = ' + value)
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[INFO] evalCondition -> error = ' + error)
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[INFO] evalCondition -> errorMessage = ' + errorMessage)
}
function evalFormula(node) {
let value
let error
let errorMessage
try {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[INFO] evalFormula -> ' + node.name + ' -> code = ' + node.code)
@@ -290,12 +300,12 @@ exports.newSuperalgosBotModulesTradingSystem = function (processIndex) {
will not be considered an error.
*/
value = 0
error = err.message
errorMessage = err.message
}
if (error !== undefined) {
tradingSystem.errors.push([node.id, error])
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[INFO] evalFormula -> error = ' + error)
if (errorMessage !== undefined) {
tradingSystem.errors.push([node.id, errorMessage])
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[INFO] evalFormula -> errorMessage = ' + errorMessage)
return
}
if (value !== undefined) {
@@ -0,0 +1,51 @@
exports.newSuperalgosUtilitiesDocsFunctions = function () {
let thisObject = {
buildPlaceholder: buildPlaceholder
}
return thisObject
function buildPlaceholder(docs, error, nodeName, nodeCode, nodeConfig) {
if (error.message !== undefined) {
docs.placeholder.errorMessage = {
style: 'Error',
text: error.message
}
}
if (error.stack !== undefined) {
docs.placeholder.errorStack = {
style: 'Javascript',
text: error.stack
}
}
if (error.nodeCode !== undefined) {
docs.placeholder.errorCode = {
style: 'Json',
text: error.nodeCode
}
}
docs.placeholder.errorDetails = {
style: 'Json',
text: JSON.stringify(error, undefined, 4)
}
if (nodeName !== undefined) {
docs.placeholder.nodeName = {
style: 'Json',
text: JSON.stringify(nodeName, undefined, 4)
}
}
if (nodeCode !== undefined) {
docs.placeholder.nodeCode = {
style: 'Javascript',
text: nodeCode
}
}
if (nodeConfig !== undefined) {
docs.placeholder.nodeConfig = {
style: 'Json',
text: JSON.stringify(nodeConfig, undefined, 4)
}
}
}
}
@@ -26,21 +26,22 @@ function newNodesErrors() {
for (let i = 0; i < array.length; i++) {
let arrayItem = array[i]
let nodeId = arrayItem[0]
let value = arrayItem[1]
applyValue(nodeId, value)
let errorMessage = arrayItem[1]
let docs = arrayItem[2]
applyValue(nodeId, errorMessage, docs)
}
}
async function applyValue(nodeId, value) {
async function applyValue(nodeId, errorMessage, docs) {
if (UI.projects.superalgos.spaces.chartingSpace.visible !== true) { return }
let node = await UI.projects.superalgos.spaces.designSpace.workspace.getNodeById(nodeId)
if (node === undefined) { return }
if (node.payload === undefined) { return }
if (node.payload.uiObject === undefined) { return }
if (value === '') {
if (errorMessage === '') {
node.payload.uiObject.resetErrorMessage()
} else {
node.payload.uiObject.setErrorMessage(value, 3)
node.payload.uiObject.setErrorMessage(errorMessage, 3, docs)
}
}
}