From 3536d2659aa57038a86a831ddfa37115472abf75 Mon Sep 17 00:00:00 2001 From: Julian Molina Date: Thu, 21 Jan 2021 14:38:09 +0100 Subject: [PATCH 01/16] User Manual Book wip --- Projects/Superalgos/Schemas/Docs-Books/user-manual.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Projects/Superalgos/Schemas/Docs-Books/user-manual.json b/Projects/Superalgos/Schemas/Docs-Books/user-manual.json index 02cb7f670..20d2b162c 100644 --- a/Projects/Superalgos/Schemas/Docs-Books/user-manual.json +++ b/Projects/Superalgos/Schemas/Docs-Books/user-manual.json @@ -36,8 +36,9 @@ "updated": 1610310832197 }, { - "style": "Text", - "text": "Work in Progress" + "style": "Chapter", + "text": "VII->Superalgos->Topic->Low-Frequency Trading Bot->In Superalgos, the Trading Bot plays no part in the definition of the trading logic. Instead, it is the program that executes the trading logic, interacts with the exchange, and keeps track of orders.", + "updated": 1611236020198 }, { "style": "Text", From e0186e2ef7ce0ed5894f111c9728268ad989ebd9 Mon Sep 17 00:00:00 2001 From: Julian Molina Date: Thu, 21 Jan 2021 14:58:29 +0100 Subject: [PATCH 02/16] User Manual Book WIP --- Projects/Superalgos/Schemas/Docs-Books/user-manual.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Projects/Superalgos/Schemas/Docs-Books/user-manual.json b/Projects/Superalgos/Schemas/Docs-Books/user-manual.json index 20d2b162c..67aadeb94 100644 --- a/Projects/Superalgos/Schemas/Docs-Books/user-manual.json +++ b/Projects/Superalgos/Schemas/Docs-Books/user-manual.json @@ -40,9 +40,14 @@ "text": "VII->Superalgos->Topic->Low-Frequency Trading Bot->In Superalgos, the Trading Bot plays no part in the definition of the trading logic. Instead, it is the program that executes the trading logic, interacts with the exchange, and keeps track of orders.", "updated": 1611236020198 }, + { + "style": "Chapter", + "text": "VIII->Superalgos->Topic->Order Management->One of the crucial aspects of trading automation is the management of orders. The system operates with assumptions that must be verified and synchronized with the exchange. Learning how the Low-Frequency Trading Bot manages orders will help you understand the life cycle of orders and how your definitions in the Open Stage and the Close Stage affect the results.", + "updated": 1611237227549 + }, { "style": "Text", - "text": "Work in Progress" + "text": "" }, { "style": "Text", From 6d78112bc2aa949ed57716fb82fe42d7029a9b9c Mon Sep 17 00:00:00 2001 From: Julian Molina Date: Thu, 21 Jan 2021 19:35:12 +0100 Subject: [PATCH 03/16] Trading Engine Topic WIP --- .../Schemas/Docs-Books/user-manual.json | 16 +++++ ...g-bot-003-data-products-visualization.json | 32 +++++++++ ...g-engine-001-trading-engine-hierarchy.json | 24 +++++++ ...ng-engine-002-monitoring-runtime-data.json | 68 +++++++++++++++++++ ...trading-engine-003-trading-bot-output.json | 28 ++++++++ 5 files changed, 168 insertions(+) create mode 100644 Projects/Superalgos/Schemas/Docs-Topics/low-frequency-trading-bot-003-data-products-visualization.json create mode 100644 Projects/Superalgos/Schemas/Docs-Topics/trading-engine-001-trading-engine-hierarchy.json create mode 100644 Projects/Superalgos/Schemas/Docs-Topics/trading-engine-002-monitoring-runtime-data.json create mode 100644 Projects/Superalgos/Schemas/Docs-Topics/trading-engine-003-trading-bot-output.json diff --git a/Projects/Superalgos/Schemas/Docs-Books/user-manual.json b/Projects/Superalgos/Schemas/Docs-Books/user-manual.json index 67aadeb94..6c4651588 100644 --- a/Projects/Superalgos/Schemas/Docs-Books/user-manual.json +++ b/Projects/Superalgos/Schemas/Docs-Books/user-manual.json @@ -56,6 +56,22 @@ { "style": "Text", "text": "Work in Progress" + }, + { + "style": "Text", + "text": "Work in Progress" + }, + { + "style": "Text", + "text": "Work in Progress" + }, + { + "style": "Text", + "text": "Work in Progress" + }, + { + "style": "Text", + "text": "" } ] } \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/low-frequency-trading-bot-003-data-products-visualization.json b/Projects/Superalgos/Schemas/Docs-Topics/low-frequency-trading-bot-003-data-products-visualization.json new file mode 100644 index 000000000..a23fb2308 --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/low-frequency-trading-bot-003-data-products-visualization.json @@ -0,0 +1,32 @@ +{ + "topic": "Low-Frequency Trading Bot", + "pageNumber": "3", + "type": "Data Products Visualization", + "definition": { + "text": "The Superalgos trading bot outputs several data products which may be visualized on the frontend application in multiple manners.", + "updated": 1611240250659 + }, + "paragraphs": [ + { + "style": "Text", + "text": "The Low-Frequency trading bot outputs tens of data products, which are made available for others to use through the data structure provided by the Trading Engine hierarchy, the Trading System involved in the trading session, and the time machines installed to visualize the trading simulations.", + "updated": 1611252948830 + }, + { + "style": "Success", + "text": "The Trading Bot Layers interactive tutorial available in the Weak-Hands Buster v.2 plugin workspace covers all the trading bot features that enable the visualization of trading information:" + }, + { + "style": "List", + "text": "Visualization of simulations over the chart for all types of trading sessions." + }, + { + "style": "List", + "text": "Visualization of all the trading information managed by the trading bot on the trading engine hierarchy." + }, + { + "style": "List", + "text": "Visualization of event highlights, values, warnings, errors, and general information concerning the trading system." + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/trading-engine-001-trading-engine-hierarchy.json b/Projects/Superalgos/Schemas/Docs-Topics/trading-engine-001-trading-engine-hierarchy.json new file mode 100644 index 000000000..dbba385f0 --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/trading-engine-001-trading-engine-hierarchy.json @@ -0,0 +1,24 @@ +{ + "topic": "Trading Engine", + "pageNumber": "1", + "type": "Trading Engine Hierarchy", + "definition": { + "text": "The trading engine provides a feedback loop to trading systems so that your strategies may leverage the information processed by the trading bot.", + "updated": 1611253515308 + }, + "paragraphs": [ + { + "style": "Include", + "text": "Superalgos->Node->Trading Engine->Definition", + "updated": 1611253576142 + }, + { + "style": "Include", + "text": "Superalgos->Node->Trading Engine->Content" + }, + { + "style": "Success", + "text": "The trading engine hierarchy is deep and large, with many ramifications. It is best to learn it through hands-on experimentation, by testing an existing trading system." + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/trading-engine-002-monitoring-runtime-data.json b/Projects/Superalgos/Schemas/Docs-Topics/trading-engine-002-monitoring-runtime-data.json new file mode 100644 index 000000000..39ea663b5 --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/trading-engine-002-monitoring-runtime-data.json @@ -0,0 +1,68 @@ +{ + "topic": "Trading Engine", + "pageNumber": "2", + "type": "Monitoring Runtime Data", + "definition": { + "text": "Use the trading engine hierarchy to track every piece of information processed by the trading bot, candle by candle.", + "updated": 1611253725593 + }, + "paragraphs": [ + { + "style": "Text", + "text": "The trading engine hierarchy is a portal into the trading bot’s machine room—the brain. Think of the trading engine as a terminal connected to each of the brain’s neurons, taking a snapshot for every candle, and registering with precision every piece of data handled by the trading bot during the trading session.", + "updated": 1611253749127 + }, + { + "style": "Text", + "text": "Superalgos combines the time navigation features of the charts with the visual environment representing data structures of the design space, to create an immersive user experience." + }, + { + "style": "Callout", + "text": "Each of the nodes in the hierarchy may display its value on the design space, right below the icon representing the node, for each candle." + }, + { + "style": "Note", + "text": "How users may monitor the information featured in the Trading Engine hierarchy is explained and demonstrated on the Trading Bot Layers tutorial available on the Weak-hands Buster V2.0 plugin workspace.", + "updated": 1611253775463 + }, + { + "style": "Text", + "text": "As a quick refresher, the process is more or less as follows:" + }, + { + "style": "List", + "text": "Run a trading session. Start with a backtest, so that you may get a quick feel of how the Trading Engine hierarchy displays data spanning any period.", + "updated": 1611253817389 + }, + { + "style": "List", + "text": "Go to the chart displaying the simulation and find one of the positions.", + "updated": 1611253824254 + }, + { + "style": "List", + "text": "Turn on the Current Position layer in the Trading Engine layer manager. This layer monitors the position structure of nodes under the current node, that is, the information regarding current positions.", + "updated": 1611253835635 + }, + { + "style": "List", + "text": "Split the screen to make room for both the design space and the charting space.", + "updated": 1611253840769 + }, + { + "style": "List", + "text": "Position the view on the design space so that you may see the corresponding structure of nodes.", + "updated": 1611253852074 + }, + { + "style": "List", + "text": "Slide the pointer of the mouse over the charts, across the position, and notice how the values for each node displayed on the design space change. Each node displays the corresponding value for each candle.", + "updated": 1611253859589 + }, + { + "style": "Success", + "text": "Much of the data handled by the trading engine may also be visualized over the charts through the layers and panels in the Trading Charts layer manager. If any of the above is not clear, please refer to the Trading Bot Layers Tutorial available on the Weak-hands Buster V2.0 plugin workspace.", + "updated": 1611253891479 + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/trading-engine-003-trading-bot-output.json b/Projects/Superalgos/Schemas/Docs-Topics/trading-engine-003-trading-bot-output.json new file mode 100644 index 000000000..09aa872d7 --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/trading-engine-003-trading-bot-output.json @@ -0,0 +1,28 @@ +{ + "topic": "Trading Engine", + "pageNumber": "3", + "type": "Trading Bot Output", + "definition": { + "text": "The trading bot stores every piece of information processed in files, making all data accessible to others, both online and offline.", + "updated": 1611254037722 + }, + "paragraphs": [ + { + "style": "Text", + "text": "As explained elsewhere, the trading bot makes the information it processes available to users through the hierarchy of the trading engine, which may be visualized both on the design space and over the charts. It also makes it available to trading systems.", + "updated": 1611254053601 + }, + { + "style": "Text", + "text": "On top of that, the information is also stored in files, sorted by concept. These makes the runtime information available to other processes and external systems, to be accessed both online, that is, at runtime, of offline." + }, + { + "style": "Text", + "text": "The trading bot outputs files on the node it runs on, particularly, in the following location:" + }, + { + "style": "Json", + "text": "Data Storage > [Exchange] > [Market] > Masters-Trading > Low-Frequency > Output > [Session] > Concept > Multi-Period-[Daily/Market] > Time Frame" + } + ] +} \ No newline at end of file From 3ea470bf60daa2f117b97afb8b5966eda1ae95d7 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 21 Jan 2021 20:14:57 +0100 Subject: [PATCH 04/16] Bug Fixed Issue #318. Using # in the name of the trading system didn't show backtest results. --- Client/WebServer/index.html | 2 +- Client/httpInterface.js | 7 ++++++- README.md | 2 +- UI/Data-Files/src/FileStorage.js | 7 +++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Client/WebServer/index.html b/Client/WebServer/index.html index d98447b00..68b4975d4 100644 --- a/Client/WebServer/index.html +++ b/Client/WebServer/index.html @@ -62,7 +62,7 @@ Jeff Braun, rico4dev, 9808us, Barry Low, Nikola Bjelogrlic, Hirajin Koizuko, Francisco J. Santillán, Norman, Viktoria B., Guillermo V., Daniel J., Javier A., Gustavo J., Romina GS, Pedro P., Thais M., Andrey M., Loui M., Natalia M., Bashar A., Carlos V., - Diego M., + Diego M., CarnivalBen, Sebastian E., Bogdan P., Marko V., Igor S., Niksa K., Rodrigo M., Nicanor M., Alejandro P., Mateo H., Lan T., Leon A., Uroš R., Filip M., Vladimir J. and Pavle B.

With Superalgos Beta 8, contributing is easier than ever! Become a contributor!

diff --git a/Client/httpInterface.js b/Client/httpInterface.js index 11e66375c..8bb2a9f5c 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1349,7 +1349,12 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE case 'Storage': { - respondWithFile(global.env.PATH_TO_DATA_STORAGE + '/' + httpRequest.url.substring(9), httpResponse) + let pathToFile = httpRequest.url.substring(9) + /* Unsavping # */ + for (let i = 0; i < 10; i++) { + pathToFile = pathToFile.replace('HASHTAG', '#') + } + respondWithFile(global.env.PATH_TO_DATA_STORAGE + '/' + pathToFile, httpResponse) } break diff --git a/README.md b/README.md index b29d41ed5..9438be4f4 100644 --- a/README.md +++ b/README.md @@ -261,7 +261,7 @@ Superalgos is a Community Project built by Contributors for Contributors. Learn ## Top Contributors -Luis Fernando Molina, Julian Molina, Andreja Cobeljic, Matías Benitez, Ira Miller, Eduardo Remis, Jeff Braun, rico4dev, 9808us, Barry Low, Nikola Bjelogrlic, Hirajin Koizuko, Francisco J. Santillán, Norman, Viktoria B., Guillermo V., Daniel J., Javier A., Gustavo J., Romina GS, Pedro P., Thais M., Andrey M., Loui M., Natalia M., Bashar A., Carlos V., Diego M., Sebastian E., Bogdan P., Marko V., Igor S., Niksa K., Rodrigo M., Nicanor M., Alejandro P., Mateo H., Lan T., Leon A., Uroš R., Filip M., Vladimir J. and Pavle B. +Luis Fernando Molina, Julian Molina, Andreja Cobeljic, Matías Benitez, Ira Miller, Eduardo Remis, Jeff Braun, rico4dev, 9808us, Barry Low, Nikola Bjelogrlic, Hirajin Koizuko, Francisco J. Santillán, Norman, Viktoria B., Guillermo V., Daniel J., Javier A., Gustavo J., Romina GS, Pedro P., Thais M., Andrey M., Loui M., Natalia M., Bashar A., Carlos V., Diego M., CarnivalBen, Sebastian E., Bogdan P., Marko V., Igor S., Niksa K., Rodrigo M., Nicanor M., Alejandro P., Mateo H., Lan T., Leon A., Uroš R., Filip M., Vladimir J. and Pavle B. # License diff --git a/UI/Data-Files/src/FileStorage.js b/UI/Data-Files/src/FileStorage.js index eda906c26..e4f7ae9ea 100644 --- a/UI/Data-Files/src/FileStorage.js +++ b/UI/Data-Files/src/FileStorage.js @@ -2,7 +2,7 @@ function newFileStorage(host, port) { const MODULE_NAME = 'File Storage' const INFO_LOG = false const logger = newWebDebugLog() - + const MAX_RETRY = 2 let currentRetry = 0 @@ -37,13 +37,16 @@ function newFileStorage(host, port) { if (pathComplete === false || pathComplete === undefined) { folder = 'Storage/' } - let url = folder + filePath + let url + if (host !== undefined && port !== undefined) { url = 'http://' + host + ':' + port + '/' + folder + filePath } else { url = folder + filePath } + /* Scaping # since it breaks the URL */ + url = url.replaceAll('#', 'HASHTAG') httpRequest(undefined, url, (response, fileContent) => { if (response.result === GLOBAL.DEFAULT_OK_RESPONSE.result) { callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE, fileContent) From 04d39bb1117f704c79eec52680e9b0c3868e085c Mon Sep 17 00:00:00 2001 From: Julian Molina Date: Thu, 21 Jan 2021 20:17:43 +0100 Subject: [PATCH 05/16] Trading Engine Topic WIP --- .../Docs-Concepts/reusable-snippets.json | 20 +++++ ...004-temporal-context-current-and-last.json | 76 +++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 Projects/Superalgos/Schemas/Docs-Topics/trading-engine-004-temporal-context-current-and-last.json diff --git a/Projects/Superalgos/Schemas/Docs-Concepts/reusable-snippets.json b/Projects/Superalgos/Schemas/Docs-Concepts/reusable-snippets.json index d0f9b82a3..360e27202 100644 --- a/Projects/Superalgos/Schemas/Docs-Concepts/reusable-snippets.json +++ b/Projects/Superalgos/Schemas/Docs-Concepts/reusable-snippets.json @@ -24,6 +24,26 @@ "text": "Dummy", "updated": 1610121260808 }, + { + "style": "Title", + "text": "Note for Hierarchy Tables No Discussion", + "updated": 1611254828783 + }, + { + "style": "Block", + "text": "Note for Hierarchy Tables No Discussion", + "updated": 1611254840023 + }, + { + "style": "Note", + "text": "Click on any of the nodes to get the details, including particulars on their configuration, when applicable.", + "updated": 1611254904577 + }, + { + "style": "Block", + "text": "Dummy", + "updated": 1611254890702 + }, { "style": "Title", "text": "Important for Live Sessions" diff --git a/Projects/Superalgos/Schemas/Docs-Topics/trading-engine-004-temporal-context-current-and-last.json b/Projects/Superalgos/Schemas/Docs-Topics/trading-engine-004-temporal-context-current-and-last.json new file mode 100644 index 000000000..5b221ed57 --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/trading-engine-004-temporal-context-current-and-last.json @@ -0,0 +1,76 @@ +{ + "topic": "Trading Engine", + "pageNumber": "4", + "type": "Temporal Context - Current and Last", + "definition": { + "text": "Much of the information provided by the trading engine may be accessed for the current instance of the object as well as for the last instance that was open, at any point in time.", + "updated": 1611254206670 + }, + "paragraphs": [ + { + "style": "Text", + "text": "The trading engine hierarchy is organized by context. That is, the main offspring nodes—current, last, and exchange orders—describe the context in which their respective offspring live.", + "updated": 1611254225764 + }, + { + "style": "Text", + "text": "For example, the concept of an episode—a whole run of the trading bot— exists only in the context of the current episode, as the system keeps track of one episode at the time only." + }, + { + "style": "Text", + "text": "However, the concept of a position is tracked both as the current position and the last position. This is possible because the system keeps track of all positions occurring within an episode." + }, + { + "style": "Callout", + "text": "Superalgos developers thought it was worth it to provide certain information, positions, for example, in both contexts, as this allows you—visually—and your trading system—using simple syntax—to access information about the current position and the last position at any given point in time." + }, + { + "style": "Title", + "text": "Current", + "updated": 1611254496763 + }, + { + "style": "Include", + "text": "Superalgos->Node->Current->Definition", + "updated": 1611254540559 + }, + { + "style": "Include", + "text": "Superalgos->Node->Current->Content" + }, + { + "style": "Include", + "text": "Superalgos->Concept->Reusable Snippets->Note for Hierarchy Tables No Discussion", + "updated": 1611255184563 + }, + { + "style": "Hierarchy", + "text": "Superalgos->Current->2", + "updated": 1611254736085 + }, + { + "style": "Title", + "text": "Last", + "updated": 1611254547170 + }, + { + "style": "Include", + "text": "Superalgos->Node->Last->Definition", + "updated": 1611254556715 + }, + { + "style": "Include", + "text": "Superalgos->Node->Last->Content" + }, + { + "style": "Include", + "text": "Superalgos->Concept->Reusable Snippets->Note for Hierarchy Tables No Discussion", + "updated": 1611255197793 + }, + { + "style": "Hierarchy", + "text": "Superalgos->Last->2", + "updated": 1611255233693 + } + ] +} \ No newline at end of file From 3a11c1e2b3271249858456295be7a3dabe5b9fe2 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 21 Jan 2021 20:50:43 +0100 Subject: [PATCH 06/16] Improvemnts in error handling --- Client/WebServer/index.html | 2 +- ...001-ts-process-error-unexpected-error.json | 66 +++++++++++++++++++ ...rs-001-ts-task-error-unexpected-error.json | 17 +++++ .../Indicator-Bot/SingleMarketIndicatorBot.js | 1 + .../TS/Function-Libraries/NodeJSFunctions.js | 4 ++ .../Spaces/Floating-Space/UiObjectMessage.js | 29 ++++++-- 6 files changed, 114 insertions(+), 5 deletions(-) diff --git a/Client/WebServer/index.html b/Client/WebServer/index.html index 68b4975d4..086965ed6 100644 --- a/Client/WebServer/index.html +++ b/Client/WebServer/index.html @@ -155,7 +155,7 @@