Formula evaluation to not numeric valuie, handling improved and intergrate to Docs

This commit is contained in:
Luis Fernando Molina committed 2021-01-25 14:12:39 +01:00
1 parent 4839ee9da1
commit 9885fe2c5a
5 files changed
+118 -49

No files matched your search

@@ -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": ""
@@ -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": ""
@@ -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": ""
}
]
}
@@ -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
}
@@ -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
}
}
}
}