From 9d105b3c32f7908dac3e16da6d65310b13d648d6 Mon Sep 17 00:00:00 2001 From: whtv <28059402+whtv@users.noreply.github.com> Date: Tue, 9 Mar 2021 16:38:49 +0100 Subject: [PATCH 1/6] =?UTF-8?q?Fix=20italicization=20of=20every=20=C3=A2?= =?UTF-8?q?=C2=80=C2=98This=C3=A2=C2=80=C2=99=20in=20the=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/Superalgos/Schemas/AppSchema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Projects/Superalgos/Schemas/AppSchema.json b/Projects/Superalgos/Schemas/AppSchema.json index f34d32219..82b1587f1 100644 --- a/Projects/Superalgos/Schemas/AppSchema.json +++ b/Projects/Superalgos/Schemas/AppSchema.json @@ -5958,7 +5958,7 @@ "action": "Delete UI Object", "askConfirmation": true, "confirmationLabel": "Confirm to Delete", - "label": "This", + "label": "Delete", "iconPathOn": "delete-entity", "iconPathOff": "delete-entity", "actionFunction": "payload.executeAction" @@ -19793,4 +19793,4 @@ } ] } -] \ No newline at end of file +] From c39260e1942d5eba58a88b3218c167f16b2ec2b5 Mon Sep 17 00:00:00 2001 From: Steve Langridge Date: Wed, 10 Mar 2021 11:38:11 +0200 Subject: [PATCH 2/6] Fixed small problem when doing fetchTrades for fetchOHLCVs where the fetching could get stuck on a previous day, and could not proceed to the next day. --- .../Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Projects/Superalgos/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js b/Projects/Superalgos/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js index c331e30bf..1e6f79e12 100644 --- a/Projects/Superalgos/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js +++ b/Projects/Superalgos/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js @@ -237,7 +237,7 @@ exports.newSuperalgosBotModulesHistoricOHLCVs = function (processIndex) { } } if (mustLoadRawData) { // there is raw data to load - getRawDataArray() // so fetch it from the file wehere it was saved on the last run of this process + getRawDataArray() // so fetch it from the file where it was saved on the last run of this process } function getRawDataArray() { mustLoadRawData = false @@ -260,11 +260,8 @@ exports.newSuperalgosBotModulesHistoricOHLCVs = function (processIndex) { rawDataArray = JSON.parse(text); let dataLength = rawDataArray.length if (dataLength > 1) { - let lastData = rawDataArray[dataLength - 1] - let lastTimeStamp = lastData[0] - rawDataArray.pop() // ditch the last ohlcv since it may be incomplete - dataLength = rawDataArray.length - since = lastTimeStamp // we will now start again from the last full ohlvc we had (instead of the beginning of the day) + since = rawDataArray[dataLength - 2][0] // set the beginning of the fetch back to the start of the second last ohlcv received + rawDataArray.pop() // ditch the last ohlcv received since it may be incomplete } else { rawDataArrayFile = [] // we got less than two ohlcvs so we might as well start again from the beginning of the day } @@ -506,9 +503,9 @@ exports.newSuperalgosBotModulesHistoricOHLCVs = function (processIndex) { break // end of the market } else { if (ohlcvcArray.length > limit) { - break // get enough ohlcvs for this process loop + break // got enough ohlcvs for this process loop } else { - await new Promise(resolve => setTimeout(resolve, rateLimit)) // wait for exchanges rateLimit before requesting again + await new Promise(resolve => setTimeout(resolve, rateLimit)) // wait for exchange's rateLimit before requesting again } } } From bbbdb43cdd7e5ad5505e932252de50247a5828e9 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 10 Mar 2021 11:24:36 +0100 Subject: [PATCH 3/6] Webhooks Updated --- Client/httpInterface.js | 6 + Projects/Superalgos/Schemas/AppSchema.json | 2 +- ...ntegrations-002-webhook-notifications.json | 241 +++++++++++++++--- .../UI/Function-Libraries/WebhookFunctions.js | 2 + 4 files changed, 213 insertions(+), 38 deletions(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index fc78aada2..7eb1064bf 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -257,6 +257,9 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE webhookMessages = [] } + console.log('[INFO] httpInterface -> Webhook -> Fetch-Messages -> Exchange-Market = ' + exchange + '-' + market) + console.log('[INFO] httpInterface -> Webhook -> Fetch-Messages -> Messeges Fetched by Webhooks Sensor Bot = ' + webhookMessages.length) + respondWithContent(JSON.stringify(webhookMessages), httpResponse) webhookMessages = [] @@ -299,6 +302,9 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE webhookMessages.push([timestamp, source, messageReceived]) webhook.set(key, webhookMessages) + console.log('[INFO] httpInterface -> Webhook -> New-Message -> Exchange-Market = ' + exchange + '-' + market) + console.log('[INFO] httpInterface -> Webhook -> New-Message -> messageReceived = ' + messageReceived) + console.log('[INFO] httpInterface -> Webhook -> New-Message -> Messeges waiting to be Fetched by Webhooks Sensor Bot = ' + webhookMessages.length) respondWithContent(JSON.stringify(global.DEFAULT_OK_RESPONSE), httpResponse) } break diff --git a/Projects/Superalgos/Schemas/AppSchema.json b/Projects/Superalgos/Schemas/AppSchema.json index f34d32219..1eb5dd2ec 100644 --- a/Projects/Superalgos/Schemas/AppSchema.json +++ b/Projects/Superalgos/Schemas/AppSchema.json @@ -15122,7 +15122,7 @@ "config": true }, "initialValues": { - "config": "{ \n\"webhookURL\": \"Webhook/New-Message/Trading-View/Binance/BTC-USDT\",\n\"testMessage\": \"\" \n}" + "config": "{ \n\"webhookURL\": \"Webhook/New-Message/Trading-View/binance/BTC-USDT\",\n\"testMessage\": \"\" \n}" }, "propertyNameAtParent": "signalsProviders", "childrenNodesProperties": [], diff --git a/Projects/Superalgos/Schemas/Docs-Topics/integrations-002-webhook-notifications.json b/Projects/Superalgos/Schemas/Docs-Topics/integrations-002-webhook-notifications.json index 9e172fe13..a559a5057 100644 --- a/Projects/Superalgos/Schemas/Docs-Topics/integrations-002-webhook-notifications.json +++ b/Projects/Superalgos/Schemas/Docs-Topics/integrations-002-webhook-notifications.json @@ -3,8 +3,8 @@ "pageNumber": "2", "type": "Webhook Notifications", "definition": { - "text": "Receive webhook notifications from other systems and use them as signals in your strategies.", - "updated": 1611486052936 + "text": "Receive webhook notifications from other systems like Trading View, and use them as signals in your strategies.", + "updated": 1615365927821 }, "paragraphs": [ { @@ -17,8 +17,29 @@ "text": "Superalgos allows you to receive webhook notifications from TradingView or any other system supporting webhooks. You may use this feature to turn notifications into signals upon which you may act from within your strategies." }, { - "style": "Text", - "text": "The system’s Web Server receives notifications and serves them to a sensor bot running as a data mining task. The sensor creates a data product with several properties which are made available to be used from within strategies." + "style": "Title", + "text": "How does it Work?", + "updated": 1615366465462 + }, + { + "style": "List", + "text": "Receving Data: the Client receives via it's http interface notifications from external sources (like Trading View) and keep the data received in-memory. This happens independently of the Webhooks Sensor Bot, meaning that it does not matter if the Webhook Sensor Bot is running or not.", + "updated": 1615366502234 + }, + { + "style": "List", + "text": "Retrieving Data: The Webhooks Sensor Bot, when it is running, queries the Client and ask it for the in-memory data it holds.", + "updated": 1615366526381 + }, + { + "style": "List", + "text": "Saving Data: The Webhooks Sensor Bot saves this data to disk.", + "updated": 1615366538404 + }, + { + "style": "List", + "text": "Consuming Data: A Trading Bot running a Strategy, might consume the data saved by the Webhooks Sensor Bot.", + "updated": 1615366547425 }, { "style": "Text", @@ -26,19 +47,11 @@ }, { "style": "Title", - "text": "Set-up the Webhooks Sensor Bot Tasks" + "text": "Set-up the Client for Webhooks" }, { "style": "Text", - "text": "The Masters data mine features the definition of the Webhooks sensor bot used to monitor incoming notifications. You need to run an instance of this bot in the data mining section of the exchange and market of your choice." - }, - { - "style": "Text", - "text": "The default workspace does not feature these tasks. To create a task for the Webhooks sensor bot, you need to uninstall and re-install the corresponding market." - }, - { - "style": "Text", - "text": "Once the Webhooks sensor task is set up and running, you are all set at the application level. It’s that simple." + "text": "There is nothing to configure in order for the Client to receive webhooks calls from external systems. The only thing you might need to do is to change the http interface port number at the Environment.js file if and only if your signals provider has any constraints regarding the port number it can send the notifications to." }, { "style": "Title", @@ -54,21 +67,143 @@ }, { "style": "Json", - "text": "{\n\"webhookURL\": \"Webhook/New-Message/Trading-View/Binance/BTC-USDT\",\n\"testMessage\": \"\"\n}", - "updated": 1611486196742 + "text": "{\n\"webhookURL\": \"Webhook/New-Message/Trading-View/binance/BTC-USDT\",\n\"testMessage\": \"\"\n}", + "updated": 1615370606690 }, { "style": "List", - "text": "webhookURL: This is the URL you need to use for testing purposes. Make sure you refer to the correct exchange and market." + "text": "webhookURL: This is the URL you need to use for testing purposes. Make sure you refer to the correct exchange and market. Something very similar to this, you will configure later at Trading View or other Signal Provider. ", + "updated": 1615368679683 }, { "style": "List", - "text": "testMessage: Enter any message, for testing purposes." + "text": "testMessage: Enter any message, for testing purposes. This message will be what you will use at your Trading System conditions to know which type of signal you received. ", + "updated": 1615368846219 + }, + { + "style": "Subtitle", + "text": "testMessage Examples" + }, + { + "style": "Javascript", + "text": "BUY" + }, + { + "style": "Javascript", + "text": "SELL" + }, + { + "style": "Javascript", + "text": "TRIGGER ON" + }, + { + "style": "Javascript", + "text": "TRIGGER OFF" + }, + { + "style": "Javascript", + "text": "TAKE POSITION" + }, + { + "style": "Subtitle", + "text": "Send the Test Message to the Client", + "updated": 1615368890166 }, { "style": "Text", "text": "Once the test message is configured, select Send Test Message on the menu." }, + { + "style": "Success", + "text": "By doing this, you are simulating being Trading View's server and sending the message in the exact same way they would do it, to the Superalgos Client you are running. " + }, + { + "style": "Text", + "text": "The Client does not know you are sending a Test Message, and it does not know it is you and not the real Trading View. For the Client's point of view someone sent a Webhook message to it and it will do with it what it will do with any other message of this type. Store it in-memory waiting for the Webhook Sensor Bot to fetch the pending messages, in which case the Client will delete them upon delivery to the Sensor Bot.", + "updated": 1615369237281 + }, + { + "style": "Note", + "text": "At the Signals Provider node you will see a message of failure or success depending if the message was succesfuly delivered to the Client or not." + }, + { + "style": "Note", + "text": "At the Client 's console, you will see 3 lines of logs, aknolidging that the message was received or if something was wrong, an error message with the cause." + }, + { + "style": "Text", + "text": "The success logs looks like this:" + }, + { + "style": "Javascript", + "text": "[INFO] httpInterface -> Webhook -> New-Message -> Exchange-Market = binance-BTC-USDT\n[INFO] httpInterface -> Webhook -> New-Message -> messageReceived = Sell\n[INFO] httpInterface -> Webhook -> New-Message -> Messeges waiting to be Ferched by Webhooks Sensor Bot = 1", + "updated": 1615370618823 + }, + { + "style": "Title", + "text": "Set-up the Webhooks Sensor Bot Tasks", + "updated": 1615370044893 + }, + { + "style": "Text", + "text": "The Masters Data Mine features the definition of the Webhooks sensor bot used to monitor incoming notifications. You need to run an instance of this bot in the data mining section of the exchange and market of your choice.", + "updated": 1615370092995 + }, + { + "style": "Text", + "text": "The default workspace does not feature these tasks. To create a task for the Webhooks sensor bot, you need to uninstall and re-install the corresponding market." + }, + { + "style": "Success", + "text": "Once the Webhooks sensor task is set up, you are all set at the application level. It’s that simple.", + "updated": 1615370160742 + }, + { + "style": "Title", + "text": "Running the Webhooks Sensor Bot" + }, + { + "style": "Text", + "text": "Now that you have verified that the Client is receiving the signal messages and storing them for you, the next thing to do is to run the Webhooks Sensor Bot so that it fetches the signals from the Client and saves them on disk in the format that later can be consumed from strategies.", + "updated": 1615369878800 + }, + { + "style": "Text", + "text": "By default, this bot will run every 30 seconds. Each time it runs you will see logs entries at the Client 's console similar to this:" + }, + { + "style": "Javascript", + "text": "2021-03-10T09:57:40.111Z Binance BTC/USDT Masters Webhooks Check-Webhook Main Loop # 3\n[INFO] httpInterface -> Webhook -> Fetch-Messages -> Exchange-Market = binance-BTC-USDT\n[INFO] httpInterface -> Webhook -> Fetch-Messages -> Messeges Fetched by Webhooks Sensor Bot = 0", + "updated": 1615370294905 + }, + { + "style": "Title", + "text": "Send Test Messages while Sensor Bot is Running", + "updated": 1615371461320 + }, + { + "style": "Text", + "text": "Now that you know how to send test messages, try doing that while the Sensor Bot is running. By looking at the Client 's console you will be able to see what is going on:", + "updated": 1615370466427 + }, + { + "style": "List", + "text": "The Client accumulates the signas received.", + "updated": 1615370477786 + }, + { + "style": "List", + "text": "The Sensor Bot fetches all the accumulated signals every time it runs." + }, + { + "style": "Text", + "text": "In the example below I sent 3 signal messages from the UI to the Client, and then the Sensor Bot fetch them all." + }, + { + "style": "Javascript", + "text": "[INFO] httpInterface -> Webhook -> New-Message -> Exchange-Market = binance-BTC-USDT\n[INFO] httpInterface -> Webhook -> New-Message -> messageReceived = Sell\n[INFO] httpInterface -> Webhook -> New-Message -> Messeges waiting to be Fetched by Webhooks Sensor Bot = 1\n[INFO] httpInterface -> Webhook -> New-Message -> Exchange-Market = binance-BTC-USDT\n[INFO] httpInterface -> Webhook -> New-Message -> messageReceived = Sell\n[INFO] httpInterface -> Webhook -> New-Message -> Messeges waiting to be Fetched by Webhooks Sensor Bot = 2\n[INFO] httpInterface -> Webhook -> New-Message -> Exchange-Market = binance-BTC-USDT\n[INFO] httpInterface -> Webhook -> New-Message -> messageReceived = Sell\n[INFO] httpInterface -> Webhook -> New-Message -> Messeges waiting to be Fetched by Webhooks Sensor Bot = 3\n2021-03-10T10:04:40.472Z Binance BTC/USDT Masters Webhooks Check-Webhook Main Loop # 17\n[INFO] httpInterface -> Webhook -> Fetch-Messages -> Exchange-Market = binance-BTC-USDT\n[INFO] httpInterface -> Webhook -> Fetch-Messages -> Messeges Fetched by Webhooks Sensor Bot = 3", + "updated": 1615370778562 + }, { "style": "Title", "text": "Webhooks Sensor Bot Output" @@ -80,8 +215,18 @@ }, { "style": "Json", - "text": "\\Data-Storage\\Exchange\\Market\\Masters\\Webhooks\\Output\\External-Signals\\Single-File\\", - "updated": 1611486278677 + "text": " Data-Storage\\Project\\Superalgos\\Data-Mine\\Masters\\Webhooks\\Exchange-Id\\Market\\Output\\External-Signals\\Single-File\n", + "updated": 1615371100856 + }, + { + "style": "Text", + "text": "Based on our tests, the location you would find the file would be:", + "updated": 1615371008258 + }, + { + "style": "Json", + "text": "Data-Storage\\Project\\Superalgos\\Data-Mine\\Masters\\Webhooks\\binance\\BTC-USDT\\Output\\External-Signals\\Single-File", + "updated": 1615371017985 }, { "style": "Text", @@ -94,11 +239,13 @@ }, { "style": "Text", - "text": "This is what the file may look like, assuming you sent four different test messages:" + "text": "This is what the file may look like after the 3 test messages we sent:", + "updated": 1615370943470 }, { "style": "Json", - "text": "[[1587998459260,\"Trading-View\",\"Sell\"],[1587998475409,\"Trading-View\",\"Buy\"],[1587998530190,\"Trading-View\",\"A custom signal I just configured\"],[1588000300940,\"Trading-View\",\"This is my new message\"]]" + "text": "[[1615370665064,\"Trading-View\",\"Sell\"],[1615370665655,\"Trading-View\",\"Sell\"],[1615370666472,\"Trading-View\",\"Sell\"]]\n", + "updated": 1615370924302 }, { "style": "Text", @@ -106,15 +253,18 @@ }, { "style": "List", - "text": "timestamp: the Unix datetime of the message." + "text": "timestamp: the Unix datetime of the message. This is the moment in time the Client received the signal from the external Signals provider.", + "updated": 1615371169447 }, { "style": "List", - "text": "source: the name of the signal provider." + "text": "source: the name of the Signal Provider. This comes as part of the message sent by the provider, because is part of the URL you will specify later at the Signal Provider's system. In our example we used Trading View, but in fact it could be any other provider. You will have this property available at your Trading System, meaning that you will be able to write conditions that distingish the signal by Signal Provider.", + "updated": 1615371322994 }, { "style": "List", - "text": "message: the message set up at the provider’s system." + "text": "message: the message set up at the provider’s system (BUY, SELL, etc.).", + "updated": 1615371373274 }, { "style": "Title", @@ -142,7 +292,8 @@ }, { "style": "Javascript", - "text": "chart.atAnyTimeFrame.externalSignal.source === \"Trading-View\" && chart.atAnyTimeFrame.externalSignal.message === \"Buy\"" + "text": "chart.atAnyTimeFrame.externalSignal.source === \"Trading-View\" && \nchart.atAnyTimeFrame.externalSignal.message === \"BUY\"", + "updated": 1615371544991 }, { "style": "Text", @@ -150,7 +301,8 @@ }, { "style": "Javascript", - "text": "chart.atAnyTimeFrame.externalSignal.previous.message === \"Buy\"" + "text": "chart.atAnyTimeFrame.externalSignal.previous.message === \"BUY\"", + "updated": 1615371536367 }, { "style": "Text", @@ -164,9 +316,31 @@ "style": "Text", "text": "In the above example, the first parameter chart.atAnyTimeFrame.externalSignal is the signal object you wish to check, and the second parameter chart.at01hs.candle is any other object that is delimited in time. In this case, the condition validates true if the last message falls within the last 1-hour candle." }, + { + "style": "Warning", + "text": "The reason to make this validation is to avoid situations where the Webhook sensor bot was not running and it retrieved from the Client signals that are already old. If you do not check the age of the signal you might get into the situation where you are triggering a buy or sell based on old data." + }, { "style": "Title", - "text": "Set-up Alerts/Messages at the Provider" + "text": "Set-up your Firewall / Rounter to accept Incoming Connections" + }, + { + "style": "Text", + "text": "As you might have imagined, you will need to open a port at your rounter / firewall to accept incomming connections from the signal provider's servers (like Trading View for instance). This is what allows that server to connect to the server where the Client is running, enabling the Client to receive those signals." + }, + { + "style": "Important", + "text": "How you configure your Rounter / Firewall is up to you, and it depends on your network setup. You will need to do your research for details on how to do it, because it depends on which rounter / firewall you are using. We suggest you to include on the rules of your Firewall / Rounter the domain name or IP address of the Signal provider, so that nobody else can connect to the Client's http interface, which has, beyond Webhooks other features you don't want to expose openly to the world without restrictions.", + "updated": 1615368540044 + }, + { + "style": "Text", + "text": "What we can tell you regarding this, is that the Superalgos Client is running a very simple http server at the port configured at the Environment.js file." + }, + { + "style": "Title", + "text": "Set-up Alerts / Messages at the Signals Provider", + "updated": 1615368585310 }, { "style": "Text", @@ -182,15 +356,8 @@ }, { "style": "Json", - "text": "http://182.45.73.1:34247/Webhook/New-Message/Trading-View/Binance/BTC-USDT" - }, - { - "style": "Text", - "text": "Set-up Your Network to Accept Incoming Connections" - }, - { - "style": "Text", - "text": "Needless to say, you need to configure your network / router / firewall to allow incoming webhook messages on the corresponding port." + "text": "http://182.45.73.1:34247/Webhook/New-Message/Trading-View/binance/BTC-USDT", + "updated": 1615371762205 }, { "style": "Text", diff --git a/Projects/Superalgos/UI/Function-Libraries/WebhookFunctions.js b/Projects/Superalgos/UI/Function-Libraries/WebhookFunctions.js index 64f476412..112b1347f 100644 --- a/Projects/Superalgos/UI/Function-Libraries/WebhookFunctions.js +++ b/Projects/Superalgos/UI/Function-Libraries/WebhookFunctions.js @@ -13,8 +13,10 @@ function newSuperalgosFunctionLibraryWebhookFunctions() { function onResponse(err) { if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) { + node.payload.uiObject.setInfoMessage('Test Message sent to the Client.') callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE) } else { + node.payload.uiObject.resetErrorMessage('Could not send Test Message to the Client.') callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE) } } From af572261a9444ad3e590d0d911634bbc2d8ad118 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 10 Mar 2021 14:17:37 +0100 Subject: [PATCH 4/6] All webhooks functionality checked, docs improved. --- ...ntegrations-002-webhook-notifications.json | 196 ++++++++++++++++++ 1 file changed, 196 insertions(+) diff --git a/Projects/Superalgos/Schemas/Docs-Topics/integrations-002-webhook-notifications.json b/Projects/Superalgos/Schemas/Docs-Topics/integrations-002-webhook-notifications.json index a559a5057..59cf5d19a 100644 --- a/Projects/Superalgos/Schemas/Docs-Topics/integrations-002-webhook-notifications.json +++ b/Projects/Superalgos/Schemas/Docs-Topics/integrations-002-webhook-notifications.json @@ -320,6 +320,202 @@ "style": "Warning", "text": "The reason to make this validation is to avoid situations where the Webhook sensor bot was not running and it retrieved from the Client signals that are already old. If you do not check the age of the signal you might get into the situation where you are triggering a buy or sell based on old data." }, + { + "style": "Title", + "text": "Test that the Signal is Taken by your Strategy", + "updated": 1615377044554 + }, + { + "style": "Text", + "text": "We will make ourselves sure that from within a strategy we can react to an external Signal. To test this, plese take the following steps. All of the following goes into the current Lighting Strike Backtesting Session / Task.", + "updated": 1615379790606 + }, + { + "style": "Subtitle", + "text": "Paper Trading Session", + "updated": 1615380274411 + }, + { + "style": "Text", + "text": "Rigth click over the Backtesting Session node and select switch to Paper Trading so that we can simulate live trading without connecting to the exchange." + }, + { + "style": "Subtitle", + "text": "Set-up Session Parameters" + }, + { + "style": "Text", + "text": "Since you have reinstalled the market in order for the task of the Webhooks bot to appear at the Master Trading Mine Tasks, the setup for the Lighting Strike strategy needs to be fixed. (Assuming you are at the Getting Started Workspace). This is what we are going to do:", + "updated": 1615379719899 + }, + { + "style": "Text", + "text": "Apply this config to your Session Base Asset", + "updated": 1615379980416 + }, + { + "style": "Json", + "text": "{\n \"initialBalance\": 0\n}", + "updated": 1615382028446 + }, + { + "style": "Text", + "text": "Apply this config to the Session Quoted Asset", + "updated": 1615379973089 + }, + { + "style": "Json", + "text": "{\n \"initialBalance\": 1\n}", + "updated": 1615380003924 + }, + { + "style": "Text", + "text": "Apply this config to the Time Range", + "updated": 1615380023496 + }, + { + "style": "Json", + "text": "{\n \"initialDatetime\": \"2020-09-01\",\n \"finalDatetime\": \"2030-09-02\"\n}", + "updated": 1615380126836 + }, + { + "style": "Text", + "text": "The initialDatetime will be ingoned because we are running a Paper Trading Session. The important thing is that the finalDatetime is in the future.", + "updated": 1615380159343 + }, + { + "style": "Text", + "text": "Apply this config to the Time Frame", + "updated": 1615380180549 + }, + { + "style": "Json", + "text": "{\n \"label\": \"01-min\"\n}", + "updated": 1615380196254 + }, + { + "style": "Subtitle", + "text": "Set-up the Strategy for Webhooks Signals", + "updated": 1615380571676 + }, + { + "style": "Text", + "text": "Inside the Lighting Strike trading system locate the Trigger On Event, and paste the following into the Javascript Node of the only condition it has.", + "updated": 1615380721252 + }, + { + "style": "Javascript", + "text": "chart.atAnyTimeFrame.externalSignal.message === \"TRIGGER ON\"", + "updated": 1615380737459 + }, + { + "style": "Text", + "text": "What we are doing here is setting the strategy to be triggered once an external signal with the message TRIGGER ON is received via the Webhook Sensor Bot." + }, + { + "style": "Subtitle", + "text": "Run the Data Mining Tasks" + }, + { + "style": "Text", + "text": "For this test, since we are Paper Trading, we will need a live stream of data from the exchange. We don't need to run all the Task of Mater Data Mining, only the ones needed by the Lighting Strike strategy:" + }, + { + "style": "List", + "text": "Exchange Raw Data" + }, + { + "style": "List", + "text": "Candles Volumens" + }, + { + "style": "List", + "text": "Resistances and Supports" + }, + { + "style": "List", + "text": "Webhooks " + }, + { + "style": "Text", + "text": "" + }, + { + "style": "Subtitle", + "text": "Run Task and Session" + }, + { + "style": "Text", + "text": "Run Task and the Session, and monitor the chart that was called Backtesting (now that is our Papertrading session), at the end of the market at the 1 minute time frame. Turn on the Episodes layer and wait for a few minutes until you see the Episode icons appear at the charts.", + "updated": 1615380482184 + }, + { + "style": "Text", + "text": "Before running the task and session, delete the data at " + }, + { + "style": "Javascript", + "text": "Data-Storage\\Project\\Superalgos\\Data-Mine\\Masters\\Webhooks", + "updated": 1615381701627 + }, + { + "style": "Important", + "text": "This is not necesary the first time you run this, but if you are repeating this test, you will avoid confusions since the file of signals will be accumulating the test messages you send, and at the strategy we are not checking for the age of the messages, so it is a good idea to delete this data every time you try this procedure.", + "updated": 1615381726583 + }, + { + "style": "Subtitle", + "text": "Set-up the Signals Provider", + "updated": 1615380812487 + }, + { + "style": "Text", + "text": "At the Crypto Ecosystem, paste the following config to the Signals Provider.", + "updated": 1615380855069 + }, + { + "style": "Javascript", + "text": "{\n \"webhookURL\": \"Webhook/New-Message/Trading-View/binance/BTC-USDT\",\n \"testMessage\": \"TRIGGER ON\"\n}", + "updated": 1615380896874 + }, + { + "style": "Text", + "text": "This means that when you send this test message, you will be delivering the TRIGGER ON signal expected by the strategy." + }, + { + "style": "Subtitle", + "text": "Ready to Send the Test Message TRIGGER ON", + "updated": 1615381087734 + }, + { + "style": "Text", + "text": "Go to the charts again an turn on the Strategies layer. You should not see anything at the charts since no strategy has been triggered.", + "updated": 1615381066133 + }, + { + "style": "Success", + "text": "Now you can send the test message." + }, + { + "style": "Text", + "text": "After you see the confirmation at the UI that the message was sent, check the Client's console to verify the message was received. Then wait until the message is picked up by the Webhooks Sensor Bot. Then wait until the Trading Bot runs again." + }, + { + "style": "Text", + "text": "Go to the charts and wait until it plots the icons of the strategy, confirming that the strategy was triggered by the test message you sent." + }, + { + "style": "Note", + "text": "If all this worked, it means that it will work if the message comes from Trading View or other Signal Provider too." + }, + { + "style": "Text", + "text": "" + }, + { + "style": "Text", + "text": "" + }, { "style": "Title", "text": "Set-up your Firewall / Rounter to accept Incoming Connections" From 25272cf6156e2fad618084207ac7ccd793ce526b Mon Sep 17 00:00:00 2001 From: whtv <28059402+whtv@users.noreply.github.com> Date: Wed, 10 Mar 2021 14:44:14 +0100 Subject: [PATCH 5/6] Fix docs context menu in Firefox --- Projects/Superalgos/UI/Spaces/Docs-Space/ContextMenu.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/ContextMenu.js b/Projects/Superalgos/UI/Spaces/Docs-Space/ContextMenu.js index 6c636076f..b2dd3d6f1 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/ContextMenu.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/ContextMenu.js @@ -293,7 +293,7 @@ function newSuperalgosDocsContextMenu() { We need to locate the parent node that it is a Paragraph, otherwise we could end up in an inner html element. */ - let paragraphNode = selection.baseNode + let paragraphNode = selection.anchorNode if (paragraphNode.id !== undefined && paragraphNode.parentNode.className === "docs-tooltip") { return false @@ -457,4 +457,4 @@ function newSuperalgosDocsContextMenu() { return true } } -} \ No newline at end of file +} From 8b24c357397800757914d5311779538c1028c6db Mon Sep 17 00:00:00 2001 From: teehanming Date: Wed, 10 Mar 2021 22:50:54 +0800 Subject: [PATCH 6/6] This is my contribution to Superalgos --- ...uting-to-superalgos-003-how-to-contribute-to-the-docs.json | 3 ++- ...-trading-idea-014-tutorial-step-bollinger-bands-rules.json | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Projects/Superalgos/Schemas/Docs-Topics/contributing-to-superalgos-003-how-to-contribute-to-the-docs.json b/Projects/Superalgos/Schemas/Docs-Topics/contributing-to-superalgos-003-how-to-contribute-to-the-docs.json index 5b277022f..90c57c786 100644 --- a/Projects/Superalgos/Schemas/Docs-Topics/contributing-to-superalgos-003-how-to-contribute-to-the-docs.json +++ b/Projects/Superalgos/Schemas/Docs-Topics/contributing-to-superalgos-003-how-to-contribute-to-the-docs.json @@ -19,7 +19,8 @@ }, { "style": "Link", - "text": "Docs Group->https://t.me/superalgosdocs" + "text": "Docs Group->t.me/superalgosdocs", + "updated": 1615385427537 }, { "style": "Text", diff --git a/Projects/Superalgos/Schemas/Docs-Tutorials/defining-a-trading-idea-014-tutorial-step-bollinger-bands-rules.json b/Projects/Superalgos/Schemas/Docs-Tutorials/defining-a-trading-idea-014-tutorial-step-bollinger-bands-rules.json index 0d079211f..8cc4b7c2d 100644 --- a/Projects/Superalgos/Schemas/Docs-Tutorials/defining-a-trading-idea-014-tutorial-step-bollinger-bands-rules.json +++ b/Projects/Superalgos/Schemas/Docs-Tutorials/defining-a-trading-idea-014-tutorial-step-bollinger-bands-rules.json @@ -17,8 +17,8 @@ }, { "style": "Link", - "text": "as defined by John Bollinger himself!->https://www.bollingerbands.com/bollinger-band-rules", - "updated": 1610452258290 + "text": "as defined by John Bollinger himself!->www.bollingerbands.com/bollinger-band-rules", + "updated": 1615384340218 }, { "style": "Callout",