diff --git a/.dockerignore b/.dockerignore index a9916f3df..b15d17eb1 100644 --- a/.dockerignore +++ b/.dockerignore @@ -7,3 +7,9 @@ debug.log .git* .vscode +README.md +LICENSE +CONTRIBUITING.md +CODE_OF_CONDUCT.md +./**/.vscode +Dockerfile diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 000000000..0d6c4556d --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,38 @@ +name: Publish Docker image + +on: + push: + branches: [master, develop] + +jobs: + publish: + name: Publish Image + runs-on: ubuntu-latest + steps: + - id: repository + uses: ASzc/change-string-case-action@v1 + with: + string: "${{ github.repository }}/${{ github.event.repository.name }}" + - uses: actions/checkout@v2 + - name: Preparation + id: prep + run: | + REGISTRY="ghcr.io" + IMAGE="${REGISTRY}/${{ steps.repository.outputs.lowercase }}" + TAGS="${IMAGE}:${{ github.sha }}" + if [[ $GITHUB_REF == ref/head/master ]]; then + TAGS="${TAGS},${IMAGE}:latest" + fi + echo ::set-output name=tags::${TAGS} + - name: Login in to registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} + - name: Push to registry + uses: docker/build-push-action@v2 + with: + push: true + file: ./Docker/Dockerfile + tags: ${{ steps.prep.outputs.tags }} diff --git a/Projects/Superalgos/Icons-SVG-Sources/exchanges/luno.svg b/Projects/Superalgos/Icons-SVG-Sources/exchanges/luno.svg new file mode 100644 index 000000000..e8b92bca2 --- /dev/null +++ b/Projects/Superalgos/Icons-SVG-Sources/exchanges/luno.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Projects/Superalgos/Icons-SVG-Sources/flags/ZA.svg b/Projects/Superalgos/Icons-SVG-Sources/flags/ZA.svg new file mode 100644 index 000000000..fabc3234e --- /dev/null +++ b/Projects/Superalgos/Icons-SVG-Sources/flags/ZA.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/Projects/Superalgos/Icons/ZA.png b/Projects/Superalgos/Icons/ZA.png new file mode 100644 index 000000000..87a7276e2 Binary files /dev/null and b/Projects/Superalgos/Icons/ZA.png differ diff --git a/Projects/Superalgos/Icons/luno.png b/Projects/Superalgos/Icons/luno.png new file mode 100644 index 000000000..346de0f70 Binary files /dev/null and b/Projects/Superalgos/Icons/luno.png differ diff --git a/Projects/Superalgos/Icons/zar.png b/Projects/Superalgos/Icons/zar.png new file mode 100644 index 000000000..03452a56b Binary files /dev/null and b/Projects/Superalgos/Icons/zar.png differ diff --git a/Projects/Superalgos/Schemas/AppSchema.json b/Projects/Superalgos/Schemas/AppSchema.json index c45bc5e9c..6377e2f09 100644 --- a/Projects/Superalgos/Schemas/AppSchema.json +++ b/Projects/Superalgos/Schemas/AppSchema.json @@ -14919,6 +14919,10 @@ { "codeName": "hitbtc", "iconName": "hitbtc" + }, + { + "codeName": "luno", + "iconName": "luno" } ] }, @@ -15074,6 +15078,10 @@ { "codeName": "USD", "iconName": "us-dollar" + }, + { + "codeName": "ZAR", + "iconName": "zar" } ] }, diff --git a/Projects/Superalgos/Schemas/Docs-Nodes/close-stage.json b/Projects/Superalgos/Schemas/Docs-Nodes/close-stage.json index 6062294a9..8c36f2243 100644 --- a/Projects/Superalgos/Schemas/Docs-Nodes/close-stage.json +++ b/Projects/Superalgos/Schemas/Docs-Nodes/close-stage.json @@ -8,9 +8,32 @@ "style": "Block", "text": "Content" }, + { + "style": "Title", + "text": "Optionality", + "updated": 1615101975045 + }, + { + "style": "Note", + "text": "The Close Stage is optional. That means that if you don't need it you can just delete this node and everything should work just fine. " + }, { "style": "Text", - "text": "The close stage is opened when either the stop loss or take profit targets are hit." + "text": "There are situations where users might want to execute both buy and sell orders from within the Open Stage. In those situations they might want to delete the Manage Stage and the Close Stage so that they don't execute at all. That is possible because both are optional. This is how optionality looks like at the code:", + "updated": 1615102048658 + }, + { + "style": "Javascript", + "text": "/*\nThe system allows the user not to define a close stage, because the close stage is optional.\nHere we are goint to see if that is the case and if it is, we will inmidiatelly consider \nthe close stage as closed.\n*/\nif (tradingSystem.tradingStrategies[tradingEngine.tradingCurrent.strategy.index.value].closeStage === undefined) {\n changeStageStatus('Close Stage', 'Closed', 'Close Stage Undefined')\n return\n}", + "updated": 1615102065680 + }, + { + "style": "Title", + "text": "Close Stage Concept" + }, + { + "style": "Text", + "text": "The close stage is opened when either the stop loss or take profit targets are hit. It is also opened after the position is opened if the Manage Stage is undefined." }, { "style": "Text", diff --git a/Projects/Superalgos/Schemas/Docs-Nodes/manage-stage.json b/Projects/Superalgos/Schemas/Docs-Nodes/manage-stage.json index 6d483c564..73f706b72 100644 --- a/Projects/Superalgos/Schemas/Docs-Nodes/manage-stage.json +++ b/Projects/Superalgos/Schemas/Docs-Nodes/manage-stage.json @@ -8,6 +8,34 @@ "style": "Block", "text": "Content" }, + { + "style": "Title", + "text": "Optionality", + "updated": 1615101510181 + }, + { + "style": "Note", + "text": "This Stage is optional. That means that if you do not want to deal with Stop Loss or Take Profits at your strategy, you can just delete this node and everything will continue working just fine. If you do remove this node, what will happen at runtime is that as soon as the position is triggered, the system will detect that that the Manage Stage is undefined, and it will jump it by opening the Close Stage (if it exists, because it is also optional)" + }, + { + "style": "Text", + "text": "This is how optionality looks like at the code:", + "updated": 1615101627343 + }, + { + "style": "Javascript", + "text": "/* Opening Status Procedure */\nif (tradingEngine.tradingCurrent.strategyManageStage.status.value === 'Opening') {\n /*\n The system allows the user not to define a Manage Stage, because the Manage Stage is optional.\n Here we are going to see if that is the case and if it is, we will inmidiatelly consider \n the Manage Stage as closed.\n */\n if (tradingSystem.tradingStrategies[tradingEngine.tradingCurrent.strategy.index.value].manageStage === undefined) {\n changeStageStatus('Manage Stage', 'Closed', 'Manage Stage Undefined')\n changeStageStatus('Close Stage', 'Opening')\n return\n }\n\n /* Now we switch to the Open status. */\n changeStageStatus('Manage Stage', 'Open')\n}", + "updated": 1615101667889 + }, + { + "style": "Success", + "text": "If both the Manage Stage and the Close Stage are undefined, what will happen is that whenever the Open Stage gets closed, you will exit the position.", + "updated": 1615103161873 + }, + { + "style": "Title", + "text": "Manage Stage Concept" + }, { "style": "Text", "text": "The first and foremost rule of trading is to preserve capital and its main goal is to increase it." diff --git a/Projects/Superalgos/Schemas/Docs-Nodes/size-filled.json b/Projects/Superalgos/Schemas/Docs-Nodes/size-filled.json index f819b575f..3b639832d 100644 --- a/Projects/Superalgos/Schemas/Docs-Nodes/size-filled.json +++ b/Projects/Superalgos/Schemas/Docs-Nodes/size-filled.json @@ -1,7 +1,8 @@ { "type": "Size Filled", "definition": { - "text": "Size filled is the amount of the order that has been filled at the exchange." + "text": "Size filled is the amount of the order that has been filled at the exchange. It can also represent the cumulative Size Filled of the Open or Close Stages.", + "updated": 1615100388371 }, "paragraphs": [ { diff --git a/Projects/Superalgos/Schemas/Docs-Topics/frequently-asked-questions-001-why-my-stage-is-not-closing.json b/Projects/Superalgos/Schemas/Docs-Topics/frequently-asked-questions-001-why-my-stage-is-not-closing.json index edd9dd674..9ead986d4 100644 --- a/Projects/Superalgos/Schemas/Docs-Topics/frequently-asked-questions-001-why-my-stage-is-not-closing.json +++ b/Projects/Superalgos/Schemas/Docs-Topics/frequently-asked-questions-001-why-my-stage-is-not-closing.json @@ -3,14 +3,14 @@ "pageNumber": 1, "type": "Why My Stage is not Closing?", "definition": { - "text": "One of the most common questions asked by users is why the open or close stage are not closing after the order was filled?", - "updated": 1615053580910 + "text": "One of the most common questions asked by users is why the open or close stage are not closing after the order was filled.", + "updated": 1615100269026 }, "paragraphs": [ { "style": "Note", - "text": "The shot answer is becasue the Stage Filled Size did not reach the value of the Stage Target Size. ", - "updated": 1615053684185 + "text": "The shot answer is becasue the Stage Size Filled did not reach the value of the Stage Target Size.", + "updated": 1615100332173 }, { "style": "Text", diff --git a/Projects/Superalgos/Schemas/Docs-Topics/tested-exchanges-001-binance-test-status.json b/Projects/Superalgos/Schemas/Docs-Topics/tested-exchanges-001-binance-test-status.json new file mode 100644 index 000000000..c362d379b --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/tested-exchanges-001-binance-test-status.json @@ -0,0 +1,56 @@ +{ + "topic": "Tested Exchanges", + "pageNumber": "1", + "type": "Binance Test Status", + "definition": { + "text": "Binance is fully tested for data mining and trading.", + "updated": 1615141847424 + }, + "paragraphs": [ + { + "style": "Title", + "text": "Properties", + "updated": 1615143100216 + }, + { + "style": "List", + "text": "1-min OHLCVs Capability [*]: Yes." + }, + { + "style": "List", + "text": "Market History: Starting on September 2017.", + "updated": 1615142912901 + }, + { + "style": "List", + "text": "Trading Capability [**]: Yes.", + "updated": 1615143016205 + }, + { + "style": "List", + "text": "Comments: Fully tested. Starting with Binance is recommended as the experience is seamless.", + "updated": 1615142951363 + }, + { + "style": "Text", + "text": "[*] The ability to fetch historic data for backtesting purposes has been verified." + }, + { + "style": "Text", + "text": "[**] The ability to run strategies in live-trading mode has been verified." + }, + { + "style": "Title", + "text": "Configuration" + }, + { + "style": "Json", + "text": "{\n \"codeName\": \"binance\",\n \"API\": [\n {\n \"method\": \"fetchTrades\",\n \"fetchType\": \"by Id\",\n \"fetchTradesMethod\": \"publicGetHistoricalTrades\",\n \"firstId\": \"f\"\n }\n ]\n}", + "updated": 1615143066280 + }, + { + "style": "Text", + "text": "" + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingStages.js b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingStages.js index 158ba86d5..df0e92cae 100644 --- a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingStages.js +++ b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingStages.js @@ -410,7 +410,7 @@ exports.newSuperalgosBotModulesTradingStages = function (processIndex) { if (tradingEngine.tradingCurrent.strategyManageStage.status.value === 'Opening') { /* The system allows the user not to define a Manage Stage, because the Manage Stage is optional. - Here we are goint to see if that is the case and if it is, we will inmidiatelly consider + Here we are going to see if that is the case and if it is, we will inmidiatelly consider the Manage Stage as closed. */ if (tradingSystem.tradingStrategies[tradingEngine.tradingCurrent.strategy.index.value].manageStage === undefined) { @@ -979,7 +979,7 @@ exports.newSuperalgosBotModulesTradingStages = function (processIndex) { case 'Base Asset': { if ( tradingEngineStage.stageBaseAsset.sizeFilled.value - * + * ROUNDING_ERROR_CORRECTION_FACTOR + ABSOLUTE_DUST_IN_BASE_ASSET @@ -995,7 +995,7 @@ exports.newSuperalgosBotModulesTradingStages = function (processIndex) { case 'Quoted Asset': { if ( tradingEngineStage.stageQuotedAsset.sizeFilled.value - * + * ROUNDING_ERROR_CORRECTION_FACTOR + ABSOLUTE_DUST_IN_QUOTED_ASSET diff --git a/README.md b/README.md index 71eba84f1..fe60c7529 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,16 @@ Once the app finishes loading, an interactive tutorial takes you by the hand and # Docker Deployments -We haven't tested containerized deployments, but many people in the community have. Worth noting is the fact that Superalgos doesn't touch anything outside the Superalgos folder. To uninstall, delete the folder. +- NEW: Added github action to publish docker image into github package registry + +## Docker Image +If you want to run superalgos over docker platform, you should follow the next steps: +1. [Install docker](https://docs.docker.com/engine/install/) +2. `docker login ghcr.io --username your-github-username --password-stdin` +3. `docker run -p 18041:18041 -p 34248 superalgos/superalgos` +4. Now you can access to the superalgos UI + +Note: This has not been extensively tested yet, if you run into troubles, please contact us at our [Superalgos User's Support Group](https://t.me/superalgossupport). # What is Superalgos? @@ -339,6 +348,7 @@ Or follow [Superalgos on Facebook](https://www.facebook.com/superalgos). Superalgos is a Community Project built by users for users. Learn [how you may contribute](https://superalgos.org/community-contribute.shtml). + ## 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., Carl J, 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.