diff --git a/Client/httpInterface.js b/Client/httpInterface.js index 49fcbf6ff..f1c71bc52 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -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('--', '-') diff --git a/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-001-ts-trading-session-error-session-node-with no parameters.json b/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-001-ts-trading-session-error-parameters-node-missing.json similarity index 88% rename from Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-001-ts-trading-session-error-session-node-with no parameters.json rename to Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-001-ts-trading-session-error-parameters-node-missing.json index 7274781b1..5e5e092a4 100644 --- a/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-001-ts-trading-session-error-session-node-with no parameters.json +++ b/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-001-ts-trading-session-error-parameters-node-missing.json @@ -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 diff --git a/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-002-ts-trading-session-error-initial-datetime-is not a valid date.json b/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-002-ts-trading-session-error-invalid-initial-datetime-property-value.json similarity index 56% rename from Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-002-ts-trading-session-error-initial-datetime-is not a valid date.json rename to Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-002-ts-trading-session-error-invalid-initial-datetime-property-value.json index c04690bf4..888273830 100644 --- a/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-002-ts-trading-session-error-initial-datetime-is not a valid date.json +++ b/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-002-ts-trading-session-error-invalid-initial-datetime-property-value.json @@ -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" } ] } \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-003-ts-trading-session-error-final-datetime-is not a valid date.json b/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-003-ts-trading-session-error-invalid-final-datetime-property-value.json similarity index 58% rename from Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-003-ts-trading-session-error-final-datetime-is not a valid date.json rename to Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-003-ts-trading-session-error-invalid-final-datetime-property-value.json index 82513ab1d..227c349f7 100644 --- a/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-003-ts-trading-session-error-final-datetime-is not a valid date.json +++ b/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-003-ts-trading-session-error-invalid-final-datetime-property-value.json @@ -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": "" diff --git a/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-004-ts-trading-session-error-time-frame-node-missing.json b/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-004-ts-trading-session-error-time-frame-node-missing.json new file mode 100644 index 000000000..10b0fd1af --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-004-ts-trading-session-error-time-frame-node-missing.json @@ -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 + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-005-ts-trading-session-error-label-property-missing.json b/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-005-ts-trading-session-error-label-property-missing.json new file mode 100644 index 000000000..37f319df9 --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-005-ts-trading-session-error-label-property-missing.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-006-ts-trading-session-error-invalid-label-property-value.json b/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-006-ts-trading-session-error-invalid-label-property-value.json new file mode 100644 index 000000000..37002f36b --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-006-ts-trading-session-error-invalid-label-property-value.json @@ -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 + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-007-ts-trading-session-error-session-base-asset-node-missing.json b/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-007-ts-trading-session-error-session-base-asset-node-missing.json new file mode 100644 index 000000000..9420e2764 --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-007-ts-trading-session-error-session-base-asset-node-missing.json @@ -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 + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-008-ts-trading-session-error-session-quoted-asset-node-missing.json b/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-008-ts-trading-session-error-session-quoted-asset-node-missing.json new file mode 100644 index 000000000..261ae2bae --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-008-ts-trading-session-error-session-quoted-asset-node-missing.json @@ -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 + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-009-ts-trading-session-error-initial-balance-property-missing.json b/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-009-ts-trading-session-error-initial-balance-property-missing.json new file mode 100644 index 000000000..ef4853b16 --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/ts-trading-session-errors-009-ts-trading-session-error-initial-balance-property-missing.json @@ -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 + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/TradingSession.js b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/TradingSession.js index ad6e9bea3..b037b52fc 100644 --- a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/TradingSession.js +++ b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/TradingSession.js @@ -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 } diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js b/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js index 7feccb193..337df31cb 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js @@ -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 } }