More Session Errors Pages Implemented

This commit is contained in:
Luis Fernando Molina committed 2021-01-22 18:16:22 +01:00
1 parent 9ca921e8c3
commit ba453abc6e
12 files changed
+250 -26

No files matched your search

+1 -1
View File
@@ -563,7 +563,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
}
function cleanFileName(fileName) {
for (let i = 0; i < 10; i++) {
for (let i = 0; i < 100; i++) {
fileName = fileName
.replace(' ', '-')
.replace('--', '-')
@@ -1,7 +1,7 @@
{
"topic": "TS Trading Session Errors",
"pageNumber": "1",
"type": "TS Trading Session Error - Session Node With No Parameters",
"type": "TS Trading Session Error - Parameters Node Missing",
"definition": {
"text": "The Backtesting Session, Live Trading Session, Paper Trading Session and Forward Testing Session nodes are expected to have a child of type Trading Parameters, and in this case it could not be found.",
"updated": 1611322334493
@@ -1,7 +1,7 @@
{
"topic": "TS Trading Session Errors",
"pageNumber": "2",
"type": "TS Trading Session Error - Initial Datetime Is Not A Valid Date",
"type": "TS Trading Session Error - Invalid Initial Datetime Property Value",
"definition": {
"text": "The initialDatetime property configured at the Time Range node is not recongnized as a valid Javascript Datetime.",
"updated": 1611322806779
@@ -16,6 +16,19 @@
"style": "Success",
"text": "Check Node JS Javsacript docs to learn how to correctly express a datetime value.",
"updated": 1611323830743
},
{
"style": "Title",
"text": "Current Value"
},
{
"style": "Text",
"text": "The property at the moment has the following value. Note that a value will be shown below only if you received this error, not when you navigate to this error page via other means.",
"updated": 1611335177840
},
{
"style": "Placeholder",
"text": "currentValue"
}
]
}
@@ -1,7 +1,7 @@
{
"topic": "TS Trading Session Errors",
"pageNumber": "3",
"type": "TS Trading Session Error - Final Datetime Is Not A Valid Date",
"type": "TS Trading Session Error - Invalid Final Datetime Property Value",
"definition": {
"text": "The finalDatetime property configured at the Time Range node is not recongnized as a valid Javascript Datetime.",
"updated": 1611323471271
@@ -17,6 +17,19 @@
"text": "Check Node JS Javsacript docs to learn how to correctly express a datetime value.",
"updated": 1611323848427
},
{
"style": "Title",
"text": "Current Value"
},
{
"style": "Text",
"text": "The property at the moment has the following value. Note that a value will be shown below only if you received this error, not when you navigate to this error page via other means.",
"updated": 1611335188490
},
{
"style": "Placeholder",
"text": "currentValue"
},
{
"style": "Text",
"text": ""
@@ -0,0 +1,16 @@
{
"topic": "TS Trading Session Errors",
"pageNumber": "4",
"type": "TS Trading Session Error - Time Frame Node Missing",
"definition": {
"text": "A Time Frame Node is expected and needed in order to run a Trading Session.",
"updated": 1611331109699
},
"paragraphs": [
{
"style": "Success",
"text": "Add a Time Frame Node at the Trading Parameters Node where this error poped up, check it's config and try running the Trading Session again.",
"updated": 1611331091819
}
]
}
@@ -0,0 +1,25 @@
{
"topic": "TS Trading Session Errors",
"pageNumber": "5",
"type": "TS Trading Session Error - Label Property Missing",
"definition": {
"text": "A property called label is expeceted at the Time Frame Node config, but it is missing.",
"updated": 1611332389501
},
"paragraphs": [
{
"style": "Success",
"text": "Add the label property at the Time Frame Node and try running the Trading Session again.",
"updated": 1611332549238
},
{
"style": "Title",
"text": "Example",
"updated": 1611332609003
},
{
"style": "Json",
"text": "01-min or 01-hs"
}
]
}
@@ -0,0 +1,38 @@
{
"topic": "TS Trading Session Errors",
"pageNumber": "6",
"type": "TS Trading Session Error - Invalid Label Property Value",
"definition": {
"text": "This property expects you to define the Time Frame in which the Trading Session is going to run. The current value assigned to the property is not recognized as a valid value.",
"updated": 1611333049475
},
"paragraphs": [
{
"style": "Success",
"text": "The value you currently have is invalid. You need to change it and run the Trading Session again.",
"updated": 1611333073771
},
{
"style": "Title",
"text": "Current Value"
},
{
"style": "Text",
"text": "The property at the moment has the following value. Note that a value will be shown below only if you received this error, not when you navigate to this error page via other means.",
"updated": 1611335162269
},
{
"style": "Placeholder",
"text": "currentValue"
},
{
"style": "Title",
"text": "Possible Values"
},
{
"style": "Json",
"text": " \"24-hs\",\n \"12-hs\",\n \"08-hs\",\n \"06-hs\",\n \"04-hs\",\n \"03-hs\",\n \"02-hs\",\n \"01-hs\"\n \"45-min\",\n \"40-min\",\n \"30-min\",\n \"20-min\",\n \"15-min\",\n \"10-min\",\n \"05-min\",\n \"04-min\",\n \"03-min\",\n \"02-min\",\n \"01-min\"",
"updated": 1611332924603
}
]
}
@@ -0,0 +1,16 @@
{
"topic": "TS Trading Session Errors",
"pageNumber": "7",
"type": "TS Trading Session Error - Session Base Asset Node Missing",
"definition": {
"text": "A Session Base Asset Node is expected and needed in order to run a Trading Session.",
"updated": 1611331205570
},
"paragraphs": [
{
"style": "Success",
"text": "Add a Session Base Asset Node at the Trading Parameters Node where this error poped up, check it's config and try running the Trading Session again.",
"updated": 1611331221697
}
]
}
@@ -0,0 +1,16 @@
{
"topic": "TS Trading Session Errors",
"pageNumber": "8",
"type": "TS Trading Session Error - Session Quoted Asset Node Missing",
"definition": {
"text": "A Session Quoted Asset Node is expected and needed in order to run a Trading Session.",
"updated": 1611331335567
},
"paragraphs": [
{
"style": "Success",
"text": "Add a Session Quoted Asset Node at the Trading Parameters Node where this error poped up, check it's config and try running the Trading Session again.",
"updated": 1611331377674
}
]
}
@@ -0,0 +1,16 @@
{
"topic": "TS Trading Session Errors",
"pageNumber": "9",
"type": "TS Trading Session Error - Initial Balance Property Missing",
"definition": {
"text": "A property called initialBalance is expeceted at the Session Base Asset and Session Quoted Asset Node config.",
"updated": 1611335687259
},
"paragraphs": [
{
"style": "Success",
"text": "Check the config at the Node reporting this error and make sure that this property exists. ",
"updated": 1611335725336
}
]
}
@@ -222,7 +222,7 @@
*/
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters === undefined) {
let errorMessage = "Session Node With No Parameters"
let errorMessage = "Parameters Node Missing"
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_INSTANCE_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] initialize -> checkParemeters -> " + errorMessage)
@@ -256,7 +256,7 @@
/* Check that we received valid dates */
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.type === 'Backtesting Session') {
if (isNaN(new Date(TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.timeRange.config.initialDatetime)).valueOf()) {
let errorMessage = "Initial Datetime Is Not A Valid Date"
let errorMessage = "Invalid Initial Datetime Property Value"
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_INSTANCE_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] initialize -> checkParemeters -> " + errorMessage)
@@ -264,7 +264,12 @@
project: 'Superalgos',
category: 'Topic',
type: 'TS Trading Session Error - ' + errorMessage,
placeholder: {}
placeholder: {
currentValue: {
style: "Json",
text: TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.timeRange.config.initialDatetime
}
}
}
TS.projects.superalgos.functionLibraries.sessionFunctions.sessionError(processIndex, TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.timeRange, errorMessage, docs)
@@ -272,7 +277,7 @@
}
}
if (isNaN(new Date(TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.timeRange.config.finalDatetime)).valueOf()) {
let errorMessage = "Final Datetime Is Not A Valid Date"
let errorMessage = "Invalid Initial Datetime Property Value"
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_INSTANCE_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] initialize -> checkParemeters -> " + errorMessage)
@@ -280,7 +285,12 @@
project: 'Superalgos',
category: 'Topic',
type: 'TS Trading Session Error - ' + errorMessage,
placeholder: {}
placeholder: {
currentValue: {
style: "Json",
text: TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.timeRange.config.finalDatetime
}
}
}
TS.projects.superalgos.functionLibraries.sessionFunctions.sessionError(processIndex, TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.timeRange, errorMessage, docs)
@@ -343,57 +353,118 @@
/* Time Frame */
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.timeFrame === undefined) {
let errorMessage = "Session Parameters Node with no Time Frame."
let errorMessage = "Time Frame Node Missing"
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_INSTANCE_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] initialize -> checkParemeters -> " + errorMessage)
TS.projects.superalgos.functionLibraries.sessionFunctions.sessionError(processIndex, TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters, errorMessage)
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'TS Trading Session Error - ' + errorMessage,
placeholder: {}
}
TS.projects.superalgos.functionLibraries.sessionFunctions.sessionError(processIndex, TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters, errorMessage, docs)
return false
}
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.timeFrame.config.label === undefined) {
let errorMessage = "Session Parameters Node with no Time Frame Label configuration."
let errorMessage = "Label Property Missing"
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_INSTANCE_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] initialize -> checkParemeters -> " + errorMessage)
TS.projects.superalgos.functionLibraries.sessionFunctions.sessionError(processIndex, TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.timeFrame, errorMessage)
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'TS Trading Session Error - ' + errorMessage,
placeholder: {}
}
TS.projects.superalgos.functionLibraries.sessionFunctions.sessionError(processIndex, TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.timeFrame, errorMessage, docs)
return false
}
TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.timeFrame.config.value = getTimeFrameFromLabel(TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.timeFrame.config.label)
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.timeFrame.config.value === undefined) {
let errorMessage = "Config error: label value not recognized. Try 01-min or 01-hs for example."
let errorMessage = "Invalid Label Property Value"
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_INSTANCE_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] initialize -> checkParemeters -> " + errorMessage)
TS.projects.superalgos.functionLibraries.sessionFunctions.sessionError(processIndex, TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.timeFrame, errorMessage)
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'TS Trading Session Error - ' + errorMessage,
placeholder: {
currentValue: {
style: "Json",
text: TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.timeFrame.config.label
}
}
}
TS.projects.superalgos.functionLibraries.sessionFunctions.sessionError(processIndex, TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.timeFrame, errorMessage, docs)
return false
}
/* Session Base Asset */
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.sessionBaseAsset === undefined) {
let errorMessage = "Session Parameters Node with no Session Base Asset."
let errorMessage = "Session Base Asset Node Missing"
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_INSTANCE_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] initialize -> checkParemeters -> " + errorMessage)
TS.projects.superalgos.functionLibraries.sessionFunctions.sessionError(processIndex, TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters, errorMessage)
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'TS Trading Session Error - ' + errorMessage,
placeholder: {}
}
TS.projects.superalgos.functionLibraries.sessionFunctions.sessionError(processIndex, TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters, errorMessage, docs)
return false
}
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.sessionBaseAsset.config.initialBalance === undefined) {
let errorMessage = "Session Parameters Session Base Asset with no initialBalance configuration."
let errorMessage = "Initial Balance Property Missing"
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_INSTANCE_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] initialize -> checkParemeters -> " + errorMessage)
TS.projects.superalgos.functionLibraries.sessionFunctions.sessionError(processIndex, TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.sessionBaseAsset, errorMessage)
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'TS Trading Session Error - ' + errorMessage,
placeholder: {}
}
TS.projects.superalgos.functionLibraries.sessionFunctions.sessionError(processIndex, TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.sessionBaseAsset, errorMessage, docs)
return false
}
/* Session Quoted Asset */
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.sessionQuotedAsset === undefined) {
let errorMessage = "Session Parameters Node with no Session Quoted Asset."
let errorMessage = "Session Quoted Asset Node Missing"
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_INSTANCE_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] initialize -> checkParemeters -> " + errorMessage)
TS.projects.superalgos.functionLibraries.sessionFunctions.sessionError(processIndex, TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters, errorMessage)
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'TS Trading Session Error - ' + errorMessage,
placeholder: {}
}
TS.projects.superalgos.functionLibraries.sessionFunctions.sessionError(processIndex, TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters, errorMessage, docs)
return false
}
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.sessionQuotedAsset.config.initialBalance === undefined) {
let errorMessage = "Session Parameters Session Quoted Asset with no initialBalance configuration."
let errorMessage = "Initial Balance Property Missing"
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_INSTANCE_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] initialize -> checkParemeters -> " + errorMessage)
TS.projects.superalgos.functionLibraries.sessionFunctions.sessionError(processIndex, TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.sessionQuotedAsset, errorMessage)
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'TS Trading Session Error - ' + errorMessage,
placeholder: {}
}
TS.projects.superalgos.functionLibraries.sessionFunctions.sessionError(processIndex, TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.tradingParameters.sessionQuotedAsset, errorMessage, docs)
return false
}
@@ -225,9 +225,9 @@ function newSuperalgosDocSpace() {
When an editor is on focus we will only
take care of a few combinations of key strokes
so as to tell the editor container when the user
would like to close the editor.
would like to close the editor. ESC key exits edit mode.
*/
if (event.key === 'Escape') {
if (event.key === 'Escape') {
UI.projects.superalgos.spaces.docsSpace.exitEditMode()
}
}
@@ -242,8 +242,8 @@ function newSuperalgosDocSpace() {
function exitEditMode() {
if (EDITOR_ON_FOCUS === true) {
thisObject.documentPage.exitEditMode()
EDITOR_ON_FOCUS = false
UI.projects.superalgos.spaces.docsSpace.documentPage.render()
EDITOR_ON_FOCUS = false
}
}