From 74b2ef40f85a37a5322e9a0fca2497866a343e75 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 3 Feb 2021 12:48:12 +0100 Subject: [PATCH] Documentation ready --- .../Docs-Concepts/default-exchange.json | 13 ++++ .../Schemas/Docs-Concepts/default-market.json | 13 ++++ ...1-lf-trading-bot-chart-data-structure.json | 72 +++++++++++++++++ ...-lf-trading-bot-market-data-structure.json | 72 +++++++++++++++++ ...f-trading-bot-exchange-data-structure.json | 77 +++++++++++++++++++ Projects/Superalgos/UI/Utilities/Strings.js | 7 +- 6 files changed, 253 insertions(+), 1 deletion(-) create mode 100644 Projects/Superalgos/Schemas/Docs-Concepts/default-exchange.json create mode 100644 Projects/Superalgos/Schemas/Docs-Concepts/default-market.json create mode 100644 Projects/Superalgos/Schemas/Docs-Topics/lf-trading-bot-available-data-structures-001-lf-trading-bot-chart-data-structure.json create mode 100644 Projects/Superalgos/Schemas/Docs-Topics/lf-trading-bot-available-data-structures-002-lf-trading-bot-market-data-structure.json create mode 100644 Projects/Superalgos/Schemas/Docs-Topics/lf-trading-bot-available-data-structures-003-lf-trading-bot-exchange-data-structure.json diff --git a/Projects/Superalgos/Schemas/Docs-Concepts/default-exchange.json b/Projects/Superalgos/Schemas/Docs-Concepts/default-exchange.json new file mode 100644 index 000000000..da0550999 --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Concepts/default-exchange.json @@ -0,0 +1,13 @@ +{ + "type": "Default Exchange", + "definition": { + "text": "The Default Exchange is the one referenced by the Exchange Data Tasks, Exchange Trading Tasks, Exchange Learning Tasks nodes of which a certain Task decends from. The Trading Bot running inside that Task will considere that referenced exchange to be it's Default Exchange.", + "updated": 1612352828045 + }, + "paragraphs": [ + { + "style": "Text", + "text": "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode. Then you can use doscs.save to save your changes and app.contribute to send it to the main repository." + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Concepts/default-market.json b/Projects/Superalgos/Schemas/Docs-Concepts/default-market.json new file mode 100644 index 000000000..8415e1960 --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Concepts/default-market.json @@ -0,0 +1,13 @@ +{ + "type": "Default Market", + "definition": { + "text": "The Default Market is the one referenced by the Market Data Tasks, Market Trading Tasks, Market Learning Tasks nodes of which a certain Task decends from. The Trading Bot running inside that Task will considered that reference market to be it's Default Market.", + "updated": 1612352846165 + }, + "paragraphs": [ + { + "style": "Text", + "text": "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode. Then you can use doscs.save to save your changes and app.contribute to send it to the main repository." + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/lf-trading-bot-available-data-structures-001-lf-trading-bot-chart-data-structure.json b/Projects/Superalgos/Schemas/Docs-Topics/lf-trading-bot-available-data-structures-001-lf-trading-bot-chart-data-structure.json new file mode 100644 index 000000000..d0ef677fe --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/lf-trading-bot-available-data-structures-001-lf-trading-bot-chart-data-structure.json @@ -0,0 +1,72 @@ +{ + "topic": "LF Trading Bot Available Data Structures", + "pageNumber": "1", + "type": "LF Trading Bot - Chart Data Structure", + "definition": { + "text": "The Chart Data Structure is an object that contains Indicator or Sensor bots data, available at runtime, that can be accessed from the code of Conditions and Formulas.", + "updated": 1612349390525 + }, + "paragraphs": [ + { + "style": "Note", + "text": "This Javascript object, together with the other two data structures available, ultimately defines the syntax that can be used to write conditions and formulas, and more precisely the sintax to retrieve Indicator Bot and Sensor Bot data.", + "updated": 1612349521002 + }, + { + "style": "Title", + "text": "Structure" + }, + { + "style": "List", + "text": "The root of the object is called...", + "updated": 1612351077417 + }, + { + "style": "Json", + "text": "chart" + }, + { + "style": "List", + "text": "After it these are it's valid properties...", + "updated": 1612351085368 + }, + { + "style": "Json", + "text": "at01min, at02min ... at45min, at01hs ... at24hs", + "updated": 1612349768772 + }, + { + "style": "List", + "text": "After that, it is expected the singleVariableName defined at the config of the Product Definition of an Indicator or Sensor.", + "updated": 1612351093008 + }, + { + "style": "List", + "text": "Finally the last property must be the codeName of a Record Property Node, belonging to the same Product Definition mentioned earlier.", + "updated": 1612350081190 + }, + { + "style": "Title", + "text": "Examples", + "updated": 1612350235632 + }, + { + "style": "Text", + "text": "chart.at01min.support.support5Rate", + "updated": 1612349808636 + }, + { + "style": "Text", + "text": "chart.at05min.candle.open", + "updated": 1612350213519 + }, + { + "style": "Text", + "text": "chart.at24hs.bollingerBand.movingAverage" + }, + { + "style": "Text", + "text": "" + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/lf-trading-bot-available-data-structures-002-lf-trading-bot-market-data-structure.json b/Projects/Superalgos/Schemas/Docs-Topics/lf-trading-bot-available-data-structures-002-lf-trading-bot-market-data-structure.json new file mode 100644 index 000000000..cdd0ec5bd --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/lf-trading-bot-available-data-structures-002-lf-trading-bot-market-data-structure.json @@ -0,0 +1,72 @@ +{ + "topic": "LF Trading Bot Available Data Structures", + "pageNumber": "2", + "type": "LF Trading Bot - Market Data Structure", + "definition": { + "text": "The Market Data Structure is one of the 3 data structures available at Conditions and Formulas with data from Indicator and Sensor bots.", + "updated": 1612351166683 + }, + "paragraphs": [ + { + "style": "Note", + "text": "This Javascript object can be used when you want to specify a market which is different fomr the Default Market. In this way you can access data of the ETH/USDT market from a stragegy running for example at the BTC/USDT market.", + "updated": 1612351365558 + }, + { + "style": "Title", + "text": "Structure" + }, + { + "style": "List", + "text": "The root of the object is called..." + }, + { + "style": "Json", + "text": "market", + "updated": 1612351449944 + }, + { + "style": "List", + "text": "After it you need to spacify the codeName of an Asset representing the Market Base Asset, like the following...", + "updated": 1612351559165 + }, + { + "style": "Json", + "text": "BTC, USDT, ETH... etc.", + "updated": 1612351687073 + }, + { + "style": "List", + "text": "After that again the codeName of an Asset but this time representing the Market Quoted Asset.." + }, + { + "style": "Json", + "text": "BTC, USDT, ETH... etc." + }, + { + "style": "List", + "text": "Finally you continue with the syntax of the LF Trading Bot - Chart Data Structure", + "updated": 1612352138708 + }, + { + "style": "Title", + "text": "Examples", + "updated": 1612352364588 + }, + { + "style": "Text", + "text": "market.ETH.BTC.chart.at01min.support.support5Rate", + "updated": 1612351751906 + }, + { + "style": "Text", + "text": "market.BTC.USDT.chart.at05min.candle.open", + "updated": 1612351782297 + }, + { + "style": "Text", + "text": "market.ETH.USDT.chart.at24hs.bollingerBand.movingAverage", + "updated": 1612351804074 + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/lf-trading-bot-available-data-structures-003-lf-trading-bot-exchange-data-structure.json b/Projects/Superalgos/Schemas/Docs-Topics/lf-trading-bot-available-data-structures-003-lf-trading-bot-exchange-data-structure.json new file mode 100644 index 000000000..69d6eec72 --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/lf-trading-bot-available-data-structures-003-lf-trading-bot-exchange-data-structure.json @@ -0,0 +1,77 @@ +{ + "topic": "LF Trading Bot Available Data Structures", + "pageNumber": "3", + "type": "LF Trading Bot - Exchange Data Structure", + "definition": { + "text": "Write a summary for this topic page." + }, + "paragraphs": [ + { + "style": "Note", + "text": "This Javascript object can be used when you want to specify a Cryto Exchage which is different fomr the Default Exchange. In this way you can access data from Coinbase Pro from a stragegy running for example at Binance.", + "updated": 1612351988656 + }, + { + "style": "Title", + "text": "Structure" + }, + { + "style": "List", + "text": "The root of the object is called..." + }, + { + "style": "Json", + "text": "exchange", + "updated": 1612352008621 + }, + { + "style": "List", + "text": "After it you need to spacify the codeName of a Crypto Exchange, like the following...", + "updated": 1612352057634 + }, + { + "style": "Json", + "text": "biance, bitfinex, coinbasepro... etc.", + "updated": 1612352082792 + }, + { + "style": "List", + "text": "Finally you continue with the syntax of the LF Trading Bot - Market Data Structure", + "updated": 1612352124926 + }, + { + "style": "Title", + "text": "Examples", + "updated": 1612352354839 + }, + { + "style": "Text", + "text": "exchange.poloniex.market.ETH.BTC.chart.at01min.support.support5Rate", + "updated": 1612352167087 + }, + { + "style": "Text", + "text": "exchange.bitfinex.market.BTC.USDT.chart.at05min.candle.open", + "updated": 1612352188098 + }, + { + "style": "Text", + "text": "exchange.binance.market.ETH.USDT.chart.at24hs.bollingerBand.movingAverage", + "updated": 1612352200136 + }, + { + "style": "Title", + "text": "Formula Example", + "updated": 1612352272503 + }, + { + "style": "Text", + "text": "As you can see at the following example you can have a mix of chart, market and exchange usage withing the same Formula or Condition. " + }, + { + "style": "Json", + "text": "chart.at01min.support.support5Rate +\nexchange.poloniex.market.ETH.USDT.chart.at05min.candle.close", + "updated": 1612352290634 + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/UI/Utilities/Strings.js b/Projects/Superalgos/UI/Utilities/Strings.js index 6a21f9691..6f3c955cc 100644 --- a/Projects/Superalgos/UI/Utilities/Strings.js +++ b/Projects/Superalgos/UI/Utilities/Strings.js @@ -58,7 +58,12 @@ function newSuperalgosUtilitiesStrings() { if (text[i - 1] === '.') { return false } } - if (character === '.') { dotsDetected = true } + if (character === '.') { + dotsDetected = true + if (text[i-1] !== undefined && text[i+1] !== undefined && text[i-1] !== '.' && text[i+1] !== '.'){ + return true + } + } } /* Check that there is at lest one upper case before numbers or dots */