diff --git a/Projects/Superalgos/Schemas/Docs-Topics/ts-lf-trading-bot-errors-001-ts-lf-trading-bot-error-evaluating-condition-error.json b/Projects/Superalgos/Schemas/Docs-Topics/ts-lf-trading-bot-errors-001-ts-lf-trading-bot-error-evaluating-condition-error.json index 7f546e834..d03792050 100644 --- a/Projects/Superalgos/Schemas/Docs-Topics/ts-lf-trading-bot-errors-001-ts-lf-trading-bot-error-evaluating-condition-error.json +++ b/Projects/Superalgos/Schemas/Docs-Topics/ts-lf-trading-bot-errors-001-ts-lf-trading-bot-error-evaluating-condition-error.json @@ -110,21 +110,6 @@ "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": "" diff --git a/Projects/Superalgos/Schemas/Docs-Topics/ts-lf-trading-bot-errors-002-ts-lf-trading-bot-error-evaluating-formula-error.json b/Projects/Superalgos/Schemas/Docs-Topics/ts-lf-trading-bot-errors-002-ts-lf-trading-bot-error-evaluating-formula-error.json index 092bda662..b43ad0e6a 100644 --- a/Projects/Superalgos/Schemas/Docs-Topics/ts-lf-trading-bot-errors-002-ts-lf-trading-bot-error-evaluating-formula-error.json +++ b/Projects/Superalgos/Schemas/Docs-Topics/ts-lf-trading-bot-errors-002-ts-lf-trading-bot-error-evaluating-formula-error.json @@ -110,21 +110,6 @@ "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": "" diff --git a/Projects/Superalgos/Schemas/Docs-Topics/ts-lf-trading-bot-errors-003-ts-lf-trading-bot-error-formula-value-not-a-number.json b/Projects/Superalgos/Schemas/Docs-Topics/ts-lf-trading-bot-errors-003-ts-lf-trading-bot-error-formula-value-not-a-number.json new file mode 100644 index 000000000..96aacfd96 --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/ts-lf-trading-bot-errors-003-ts-lf-trading-bot-error-formula-value-not-a-number.json @@ -0,0 +1,81 @@ +{ + "topic": "TS LF Trading Bot Errors", + "pageNumber": "3", + "type": "TS LF Trading Bot Error - Formula Value Not A Number", + "definition": { + "text": "When evaluated by teh LF Trading Bot, a Formula must return a numeric value. In this case it did not, and for that reason this error happened..", + "updated": 1611568961215 + }, + "paragraphs": [ + { + "style": "Text", + "text": "While running at the TS, the Low Frequency Trading Bot encountered an error while trying to evaluate one of your formulas defined at the Trading System. Formulas are supposed to return a numeric value an this one did not.", + "updated": 1611579417164 + }, + { + "style": "Error", + "text": "Formula Value Not A Number", + "updated": 1611580236800 + }, + { + "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": "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 Value", + "updated": 1611579496738 + }, + { + "style": "Text", + "text": "The follwing is the value of the node at the moment that this error happened at the LF Trading Bot:", + "updated": 1611579550831 + }, + { + "style": "Placeholder", + "text": "nodeValue", + "updated": 1611579573236 + }, + { + "style": "Text", + "text": "" + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingSystem.js b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingSystem.js index 279eccb53..4b078850c 100644 --- a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingSystem.js +++ b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingSystem.js @@ -318,7 +318,16 @@ exports.newSuperalgosBotModulesTradingSystem = function (processIndex) { } else { if (value !== undefined) { if (node.type === 'Formula' && isNaN(value)) { - tradingSystem.errors.push([node.id, 'Formula needs to return a number.']) + + docs = { + project: 'Superalgos', + category: 'Topic', + type: 'TS LF Trading Bot Error - Formula Value Not A Number', + placeholder: {} + } + TS.projects.superalgos.utilities.docsFunctions.buildPlaceholder(docs, undefined, node.name, node.code, undefined, value) + + tradingSystem.errors.push([node.id, 'Formula needs to return a numeric value.', docs]) return } diff --git a/Projects/Superalgos/TS/Utilities/DocsFunctions.js b/Projects/Superalgos/TS/Utilities/DocsFunctions.js index 271eb08e3..e172aab9a 100644 --- a/Projects/Superalgos/TS/Utilities/DocsFunctions.js +++ b/Projects/Superalgos/TS/Utilities/DocsFunctions.js @@ -6,29 +6,32 @@ exports.newSuperalgosUtilitiesDocsFunctions = function () { return thisObject - function buildPlaceholder(docs, error, nodeName, nodeCode, nodeConfig) { - if (error.message !== undefined) { - docs.placeholder.errorMessage = { - style: 'Error', - text: error.message + function buildPlaceholder(docs, error, nodeName, nodeCode, nodeConfig, nodeValue) { + if (error !== undefined) { + 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.stack !== undefined) { + docs.placeholder.errorStack = { + style: 'Javascript', + text: error.stack + } } - } - if (error.nodeCode !== undefined) { - docs.placeholder.errorCode = { + if (error.nodeCode !== undefined) { + docs.placeholder.errorCode = { + style: 'Json', + text: error.nodeCode + } + } + docs.placeholder.errorDetails = { style: 'Json', - text: error.nodeCode + text: JSON.stringify(error, undefined, 4) } } - docs.placeholder.errorDetails = { - style: 'Json', - text: JSON.stringify(error, undefined, 4) - } + if (nodeName !== undefined) { docs.placeholder.nodeName = { style: 'Json', @@ -47,5 +50,11 @@ exports.newSuperalgosUtilitiesDocsFunctions = function () { text: JSON.stringify(nodeConfig, undefined, 4) } } + if (nodeValue !== undefined) { + docs.placeholder.nodeValue = { + style: 'Json', + text: nodeValue + } + } } } \ No newline at end of file