Merge branch 'develop' of https://github.com/Superalgos/Superalgos into develop

This commit is contained in:
DougJCook committed 2021-03-07 16:54:48 -05:00
commit 1383401850
15 files changed
+250 -10

No files matched your search

+6
View File
@@ -7,3 +7,9 @@ debug.log
.git*
.vscode
README.md
LICENSE
CONTRIBUITING.md
CODE_OF_CONDUCT.md
./**/.vscode
Dockerfile
+38
View File
@@ -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 }}
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="-703 270 512 512" style="enable-background:new -703 270 512 512;" xml:space="preserve">
<style type="text/css">
.st0{fill:#0295AA;}
.st1{fill:#365558;}
.st2{fill:none;stroke:#FFFFFF;stroke-width:13;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st3{fill:#F0353D;}
.st4{fill:#FD6A33;}
.st5{fill:#FF8C29;}
.st6{fill:#FFD1A9;}
.st7{fill:#4ACFD9;}
.st8{fill:#9BAAAB;}
.st9{fill:#CDD4D5;}
.st10{fill:#E6EAEA;}
.st11{fill:#FFFFFF;}
.st12{fill:#BCD643;}
</style>
<path class="st0" d="M-227.5,270H-447v512h219.5c20.1,0,36.5-16.4,36.5-36.5v-439C-191,286.4-207.4,270-227.5,270z"/>
<path class="st1" d="M-666.5,270c-20.1,0-36.5,16.4-36.5,36.5v439c0,20.1,16.4,36.5,36.5,36.5H-447V270H-666.5z"/>
<g>
<path class="st2" d="M-664,477.4c0,0,0,22,0,50.1c0,28.1,17.7,44.9,31.5,44.9s32.4,0,32.4,0"/>
<path class="st2" d="M-479.2,477.4c0,0,0,11.7,0,47.5s-20.3,49.7-40.6,49.7c-20.3,0-40.6-13.8-40.6-49.7s0-47.5,0-47.5"/>
<path class="st2" d="M-351.4,574.6c0,0,0-11.7,0-47.5s-20.3-49.7-40.6-49.7c-20.3,0-40.6,13.8-40.6,49.7s0,47.5,0,47.5"/>
<circle class="st2" cx="-258.5" cy="526" r="48.5"/>
</g>
<rect x="-1330.3" y="270" class="st3" width="128" height="128"/>
<rect x="-1202.3" y="270" class="st4" width="128" height="128"/>
<rect x="-1074.3" y="270" class="st5" width="128" height="128"/>
<rect x="-946.3" y="270" class="st6" width="128" height="128"/>
<rect x="-1330.3" y="398" class="st1" width="128" height="128"/>
<rect x="-1202.3" y="398" class="st0" width="128" height="128"/>
<rect x="-1074.3" y="398" class="st7" width="128" height="128"/>
<rect x="-1330.3" y="526" class="st8" width="128" height="128"/>
<rect x="-1202.3" y="526" class="st9" width="128" height="128"/>
<rect x="-1074.3" y="526" class="st10" width="128" height="128"/>
<rect x="-946.3" y="526" class="st11" width="128" height="128"/>
<rect x="-1330.3" y="654" class="st12" width="128" height="128"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="-703 270 512 512" style="enable-background:new -703 270 512 512;" xml:space="preserve">
<style type="text/css">
.st0{clip-path:url(#SVGID_2_);}
.st1{fill:#007640;}
.st2{fill:#FFFFFF;}
.st3{fill:#002A8A;}
.st4{fill:#D42422;}
.st5{fill:#FCB612;}
</style>
<g>
<defs>
<circle id="SVGID_1_" cx="-447" cy="526" r="256"/>
</defs>
<clipPath id="SVGID_2_">
<use xlink:href="#SVGID_1_" style="overflow:visible;"/>
</clipPath>
<g id="XMLID_1174_" class="st0">
<rect id="XMLID_1181_" x="-741.4" y="270" class="st1" width="768" height="512"/>
<polygon id="XMLID_1180_" class="st2" points="-649.2,782 -342,577.2 26.6,577.2 26.6,782 "/>
<polygon id="XMLID_1179_" class="st2" points="-649.2,270 -342,474.8 26.6,474.8 26.6,270 "/>
<polygon id="XMLID_1178_" class="st3" points="-587.8,782 -331.8,611.3 26.6,611.3 26.6,782 "/>
<polygon id="XMLID_1177_" class="st4" points="-587.8,270 -331.8,440.7 26.6,440.7 26.6,270 "/>
<polygon id="XMLID_1176_" class="st5" points="-741.4,720.6 -741.4,331.4 -449.6,526 "/>
<polygon id="XMLID_1175_" points="-741.4,679.6 -741.4,372.4 -511,526 "/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

@@ -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"
}
]
},
@@ -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",
@@ -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."
@@ -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": [
{
@@ -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",
@@ -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": ""
}
]
}
@@ -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
+11 -1
View File
@@ -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.