Skip to content

Commit b39401f

Browse files
authored
Merge pull request #1927 from Drakkar-Software/dev
Update master
2 parents c80ed22 + 842891f commit b39401f

File tree

8 files changed

+74
-67
lines changed

8 files changed

+74
-67
lines changed

.do/deploy.template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ spec:
55
git:
66
branch: master
77
repo_clone_url: https://github.com/Drakkar-Software/OctoBot
8-
name: octobot
8+
name: octobot-web
99
http_port: 5001

.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
HOST=localhost
1+
HOST=octobot.localhost
2+
PORT=5001

README.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ This repository contains all the features of the bot (trading tools, evaluation
2828

2929
To install OctoBot with its tentacles, just use the [latest release for your system](https://github.com/Drakkar-Software/OctoBot/releases/latest) and your OctoBot is ready !
3030

31-
Find the answers to the most common questions in [our FAQ](https://docs.octobot.online/usage/frequently-asked-questions-faq).
31+
Find the answers to the most common questions in [our FAQ](https://octobot.info/usage/frequently-asked-questions-faq).
3232

3333
## Your Octobot
3434
<a href="https://www.octobot.online/guides/#telegram"><img src="../assets/telegram-interface.png" height="414" alt="Telegram interface"></a>
35-
[![Twitter Interface](../assets/twitter-interface.png)](https://docs.octobot.online/interfaces/twitter-interface)
35+
[![Twitter Interface](../assets/twitter-interface.png)](https://octobot.info/interfaces/twitter-interface)
3636

3737
OctoBot is highly customizable using its configuration and tentacles system.
3838
You can build your own bot using the infinite [configuration](https://www.octobot.online/guides/#trading_modes) possibilities such as
@@ -41,8 +41,8 @@ You can build your own bot using the infinite [configuration](https://www.octobo
4141
OctoBot is **AI ready**: Python being the main language for OctoBot, it's easy to integrate machine-learning libraries such as [Tensorflow](https://github.com/tensorflow/tensorflow) or
4242
any other lib and take advantage of all the available data and create a very powerful trading strategy.
4343

44-
Octobot's main feature is **evolution** : you can [install](https://docs.octobot.online/advanced_usage/tentacle-manager),
45-
[modify](https://developer.docs.octobot.online/guides/customize-your-octobot) and even [create](https://developer.docs.octobot.online/guides/developer-guide) any tentacle you want to build your ideal cryptocurrency trading robot. You can even share your OctoBot evolutions!
44+
Octobot's main feature is **evolution** : you can [install](https://octobot.info/advanced_usage/tentacle-manager),
45+
[modify](https://developer.octobot.info/guides/customize-your-octobot) and even [create](https://developer.octobot.info/guides/developer-guide) any tentacle you want to build your ideal cryptocurrency trading robot. You can even share your OctoBot evolutions!
4646

4747
## Hardware requirements
4848
- CPU : 1 Core / 1GHz
@@ -52,13 +52,13 @@ Octobot's main feature is **evolution** : you can [install](https://docs.octobot
5252
## Installation
5353
OctoBot's installation is **very simple**... because **very documented** ! See the [installation guides](https://www.octobot.online/guides/#installation) for more info.
5454

55-
#### [With executable](https://docs.octobot.online/installation/with-binary)
55+
#### [With executable](https://octobot.info/installation/with-binary)
5656
Follow the [2 steps installation guide](https://www.octobot.online/executable_installation/)
5757

5858
In short:
5959
- Use the latest release on the [release page](https://github.com/Drakkar-Software/OctoBot/releases/latest)
6060

61-
#### [With Docker](https://docs.octobot.online/installation/with-docker)
61+
#### [With Docker](https://octobot.info/installation/with-docker)
6262
Follow the [docker installation guide](https://www.octobot.online/docker_installation/)
6363

6464
In short :
@@ -67,15 +67,21 @@ docker run -itd --name OctoBot -p 80:5001 -v $(pwd)/user:/octobot/user -v $(pwd)
6767
```
6868
And then open [http://localhost](http://localhost).
6969

70-
#### [With pip](https://docs.octobot.online/installation/with-pip)
70+
With docker-compose :
71+
```
72+
docker-compose up -d
73+
```
74+
And then open [https://octobot.localhost](https://octobot.localhost).
75+
76+
#### [With pip](https://octobot.info/installation/with-pip)
7177

7278
In short :
7379
```
74-
pip install OctoBot>=0.4.0b16
80+
pip install OctoBot>=0.4.1
7581
Octobot
7682
```
7783

78-
#### [With python sources](https://docs.octobot.online/installation/with-python-only)
84+
#### [With python sources](https://octobot.info/installation/with-python-only)
7985
Follow the [python installation guide](https://www.octobot.online/python_installation/)
8086

8187
In short :
@@ -110,7 +116,7 @@ In short :
110116
[![Kucoin](../assets/kucoin-logo.png)](https://www.kucoin.com)
111117
[![Bitmex](../assets/bitmex-logo.png)](https://bitmex.com)
112118

113-
Octobot supports many [exchanges](https://exchanges.docs.octobot.online/) thanks to the [ccxt library](https://github.com/ccxt/ccxt).
119+
Octobot supports many [exchanges](https://exchanges.octobot.info/) thanks to the [ccxt library](https://github.com/ccxt/ccxt).
114120
To activate trading on an exchange, just configure OctoBot with your api keys as described [on the exchange documentation](https://www.octobot.online/guides/#exchanges).
115121

116122
## Disclaimer
@@ -123,6 +129,11 @@ expect.
123129

124130
Do not hesitate to read the source code and understand the mechanism of this bot.
125131

132+
## License
133+
GNU General Public License v3.0 or later.
134+
135+
See [LICENSE](https://github.com/Drakkar-Software/OctoBot/blob/master/LICENSE) to see the full text.
136+
126137
## Sponsors
127138
<table>
128139
<tr>

docker-compose.yml

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,32 @@ version: "3"
33
services:
44
octobot:
55
image: drakkarsoftware/octobot:stable
6-
environment:
7-
- VIRTUAL_HOST=${HOST}
8-
- VIRTUAL_PORT=5001
9-
- SELF_SIGNED_HOST=${HOST}
6+
labels:
7+
- traefik.enable=true
8+
- traefik.http.routers.octobot.rule=Host("${HOST}")
9+
- traefik.http.services.octobot.loadbalancer.server.port=${PORT}
10+
- traefik.http.routers.octobot.tls=true
1011
volumes:
1112
- ./logs:/octobot/logs
1213
- ./backtesting:/octobot/backtesting
1314
- ./tentacles:/octobot/tentacles
1415
- ./user:/octobot/user
1516
expose:
16-
- 5001
17+
- ${PORT}
1718
restart: always
1819

19-
nginx:
20-
image: jwilder/nginx-proxy:alpine
20+
traefik:
21+
image: traefik:v2.5
22+
command:
23+
- "--providers.docker=true"
24+
- "--providers.docker.exposedbydefault=false"
25+
- "--entrypoints.web.address=:80"
26+
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
27+
- "--entrypoints.web.http.redirections.entryPoint.scheme=https"
28+
- "--entrypoints.web.http.redirections.entrypoint.permanent=true"
29+
- "--entrypoints.websecure.address=:443"
2130
ports:
22-
- 80:80
23-
- 443:443
31+
- "80:80"
32+
- "443:443"
2433
volumes:
25-
- /var/run/docker.sock:/tmp/docker.sock:ro
26-
- ./ssl:/etc/nginx/certs
27-
- ./vhost.d:/etc/nginx/vhost.d
28-
restart: always
29-
privileged: true
30-
depends_on:
31-
- octobot
32-
33-
nginx-companion:
34-
container_name: proxy-companion
35-
restart: always
36-
image: sebastienheyd/self-signed-proxy-companion:latest
37-
volumes:
38-
- /var/run/docker.sock:/var/run/docker.sock:ro
39-
- ./ssl:/etc/nginx/certs
34+
- /var/run/docker.sock:/var/run/docker.sock:ro

octobot/constants.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828

2929
# OctoBot urls
3030
OCTOBOT_WEBSITE_URL = os.getenv("OCTOBOT_ONLINE_URL", "https://www.octobot.online")
31-
OCTOBOT_DOCS_URL = os.getenv("DOCS_OCTOBOT_ONLINE_URL", "https://docs.octobot.online")
32-
EXCHANGES_DOCS_URL = os.getenv("DOCS_OCTOBOT_ONLINE_URL", "https://exchanges.docs.octobot.online/")
33-
DEVELOPER_DOCS_URL = os.getenv("DOCS_OCTOBOT_ONLINE_URL", "https://developer.docs.octobot.online/")
31+
OCTOBOT_DOCS_URL = os.getenv("DOCS_OCTOBOT_ONLINE_URL", "https://octobot.info")
32+
EXCHANGES_DOCS_URL = os.getenv("DOCS_OCTOBOT_ONLINE_URL", "https://exchanges.octobot.info/")
33+
DEVELOPER_DOCS_URL = os.getenv("DOCS_OCTOBOT_ONLINE_URL", "https://developer.octobot.info/")
3434
OCTOBOT_ONLINE = os.getenv("TENTACLES_OCTOBOT_ONLINE_URL", "https://static.octobot.online")
3535
OCTOBOT_FEEDBACK = os.getenv("FEEDBACK_OCTOBOT_ONLINE_URL", "https://feedback.octobot.online/")
3636
TENTACLES_REPOSITORY = "tentacles"

requirements.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# Setup requirements
2-
cython==0.29.24
2+
cython==0.29.26
33

44
# Drakkar-Software requirements
5-
OctoBot-Commons==1.6.18
6-
OctoBot-Trading==1.14.2
7-
OctoBot-Evaluators==1.6.22
8-
OctoBot-Tentacles-Manager==2.6.3
9-
OctoBot-Services==1.2.27
10-
OctoBot-Backtesting==1.6.27
11-
Async-Channel==2.0.12
5+
OctoBot-Commons==1.6.20
6+
OctoBot-Trading==2.1.2
7+
OctoBot-Evaluators==1.6.24
8+
OctoBot-Tentacles-Manager==2.6.4
9+
OctoBot-Services==1.2.31
10+
OctoBot-Backtesting==1.6.29
11+
Async-Channel==2.0.13
1212
trading-backend==1.0.12
1313

1414
## Others
1515
colorlog==4.7.2
16-
yarl==1.6.3
16+
yarl==1.7.2
1717
idna<2.9,>=2.5
1818
requests==2.25.1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import os
1717
from setuptools import dist
1818

19-
dist.Distribution().fetch_build_eggs(['Cython==0.29.24'])
19+
dist.Distribution().fetch_build_eggs(['Cython==0.29.26'])
2020

2121
try:
2222
from Cython.Distutils import build_ext

tests/unit_tests/trading_modes_tests/trading_mode_test_toolkit.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -131,31 +131,31 @@ def check_portfolio(portfolio, initial_portfolio, orders, only_positivity=False)
131131
orders_market_amount += order.origin_quantity * order.origin_price
132132
else:
133133
orders_currency_amount += order.origin_quantity
134-
for symbol in portfolio:
135-
assert portfolio[symbol][commons_constants.PORTFOLIO_TOTAL] >= trading_constants.ZERO
136-
assert portfolio[symbol][commons_constants.PORTFOLIO_AVAILABLE] >= trading_constants.ZERO
134+
for symbol in portfolio.portfolio.keys():
135+
assert portfolio.get_currency_portfolio(symbol).total >= trading_constants.ZERO
136+
assert portfolio.get_currency_portfolio(symbol).available >= trading_constants.ZERO
137137
if not only_positivity:
138138
if order.order_type in (
139-
trading_enum.TraderOrderType.SELL_MARKET, trading_enum.TraderOrderType.BUY_MARKET):
139+
trading_enum.TraderOrderType.SELL_MARKET, trading_enum.TraderOrderType.BUY_MARKET) and \
140+
symbol in [order.market, order.currency]:
140141
# order is filled
141-
assert initial_portfolio[symbol][commons_constants.PORTFOLIO_TOTAL] != portfolio[symbol][
142-
commons_constants.PORTFOLIO_TOTAL]
143-
assert initial_portfolio[symbol][commons_constants.PORTFOLIO_AVAILABLE] != portfolio[symbol][
144-
commons_constants.PORTFOLIO_AVAILABLE]
142+
assert initial_portfolio.get_currency_portfolio(symbol).total != \
143+
portfolio.get_currency_portfolio(symbol).total
144+
assert initial_portfolio.get_currency_portfolio(symbol).available != \
145+
portfolio.get_currency_portfolio(symbol).available
145146
else:
146147
if order_symbol == symbol:
147-
assert initial_portfolio[symbol][commons_constants.PORTFOLIO_TOTAL] == portfolio[symbol][
148-
commons_constants.PORTFOLIO_TOTAL]
148+
assert initial_portfolio.get_currency_portfolio(symbol).total == \
149+
portfolio.get_currency_portfolio(symbol).total
149150
assert "{:f}".format(
150-
initial_portfolio[symbol][
151-
commons_constants.PORTFOLIO_AVAILABLE] - orders_currency_amount) == \
152-
"{:f}".format(portfolio[symbol][commons_constants.PORTFOLIO_AVAILABLE])
151+
initial_portfolio.get_currency_portfolio(symbol).available - orders_currency_amount) == \
152+
"{:f}".format(portfolio.get_currency_portfolio(symbol).available)
153153
elif market == symbol:
154-
assert initial_portfolio[market][commons_constants.PORTFOLIO_TOTAL] == portfolio[market][
155-
commons_constants.PORTFOLIO_TOTAL]
154+
assert initial_portfolio.get_currency_portfolio(market).total == \
155+
portfolio.get_currency_portfolio(market).total
156156
assert "{:f}".format(
157-
initial_portfolio[market][commons_constants.PORTFOLIO_AVAILABLE] - orders_market_amount) \
158-
== "{:f}".format(portfolio[market][commons_constants.PORTFOLIO_AVAILABLE])
157+
initial_portfolio.get_currency_portfolio(market).available - orders_market_amount) \
158+
== "{:f}".format(portfolio.get_currency_portfolio(market).available)
159159

160160

161161
async def fill_orders(orders, trader):
@@ -165,6 +165,6 @@ async def fill_orders(orders, trader):
165165
order.filled_price = order.origin_price
166166
order.filled_quantity = order.origin_quantity
167167
await order.on_fill(force_fill=True)
168-
check_portfolio(trader.exchange_manager.exchange_personal_data.portfolio_manager.portfolio.portfolio,
168+
check_portfolio(trader.exchange_manager.exchange_personal_data.portfolio_manager.portfolio,
169169
None, orders, True)
170170
assert len(trading_api.get_open_orders(trader.exchange_manager)) == 0

0 commit comments

Comments
 (0)