mirror of
https://github.com/Drakkar-Software/OctoBot.git
synced 2022-03-03 23:52:26 +03:00
@@ -5,5 +5,5 @@ spec:
|
||||
git:
|
||||
branch: master
|
||||
repo_clone_url: https://github.com/Drakkar-Software/OctoBot
|
||||
name: octobot
|
||||
name: octobot-web
|
||||
http_port: 5001
|
||||
|
||||
31
README.md
31
README.md
@@ -28,11 +28,11 @@ This repository contains all the features of the bot (trading tools, evaluation
|
||||
|
||||
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 !
|
||||
|
||||
Find the answers to the most common questions in [our FAQ](https://docs.octobot.online/usage/frequently-asked-questions-faq).
|
||||
Find the answers to the most common questions in [our FAQ](https://octobot.info/usage/frequently-asked-questions-faq).
|
||||
|
||||
## Your Octobot
|
||||
<a href="https://www.octobot.online/guides/#telegram"><img src="../assets/telegram-interface.png" height="414" alt="Telegram interface"></a>
|
||||
[](https://docs.octobot.online/interfaces/twitter-interface)
|
||||
[](https://octobot.info/interfaces/twitter-interface)
|
||||
|
||||
OctoBot is highly customizable using its configuration and tentacles system.
|
||||
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
|
||||
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
|
||||
any other lib and take advantage of all the available data and create a very powerful trading strategy.
|
||||
|
||||
Octobot's main feature is **evolution** : you can [install](https://docs.octobot.online/advanced_usage/tentacle-manager),
|
||||
[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!
|
||||
Octobot's main feature is **evolution** : you can [install](https://octobot.info/advanced_usage/tentacle-manager),
|
||||
[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!
|
||||
|
||||
## Hardware requirements
|
||||
- CPU : 1 Core / 1GHz
|
||||
@@ -52,13 +52,13 @@ Octobot's main feature is **evolution** : you can [install](https://docs.octobot
|
||||
## Installation
|
||||
OctoBot's installation is **very simple**... because **very documented** ! See the [installation guides](https://www.octobot.online/guides/#installation) for more info.
|
||||
|
||||
#### [With executable](https://docs.octobot.online/installation/with-binary)
|
||||
#### [With executable](https://octobot.info/installation/with-binary)
|
||||
Follow the [2 steps installation guide](https://www.octobot.online/executable_installation/)
|
||||
|
||||
In short:
|
||||
- Use the latest release on the [release page](https://github.com/Drakkar-Software/OctoBot/releases/latest)
|
||||
|
||||
#### [With Docker](https://docs.octobot.online/installation/with-docker)
|
||||
#### [With Docker](https://octobot.info/installation/with-docker)
|
||||
Follow the [docker installation guide](https://www.octobot.online/docker_installation/)
|
||||
|
||||
In short :
|
||||
@@ -67,15 +67,21 @@ docker run -itd --name OctoBot -p 80:5001 -v $(pwd)/user:/octobot/user -v $(pwd)
|
||||
```
|
||||
And then open [http://localhost](http://localhost).
|
||||
|
||||
#### [With pip](https://docs.octobot.online/installation/with-pip)
|
||||
With docker-compose :
|
||||
```
|
||||
docker-compose up -d
|
||||
```
|
||||
And then open [https://octobot.localhost](https://octobot.localhost).
|
||||
|
||||
#### [With pip](https://octobot.info/installation/with-pip)
|
||||
|
||||
In short :
|
||||
```
|
||||
pip install OctoBot>=0.4.0b16
|
||||
pip install OctoBot>=0.4.1
|
||||
Octobot
|
||||
```
|
||||
|
||||
#### [With python sources](https://docs.octobot.online/installation/with-python-only)
|
||||
#### [With python sources](https://octobot.info/installation/with-python-only)
|
||||
Follow the [python installation guide](https://www.octobot.online/python_installation/)
|
||||
|
||||
In short :
|
||||
@@ -110,7 +116,7 @@ In short :
|
||||
[](https://www.kucoin.com)
|
||||
[](https://bitmex.com)
|
||||
|
||||
Octobot supports many [exchanges](https://exchanges.docs.octobot.online/) thanks to the [ccxt library](https://github.com/ccxt/ccxt).
|
||||
Octobot supports many [exchanges](https://exchanges.octobot.info/) thanks to the [ccxt library](https://github.com/ccxt/ccxt).
|
||||
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).
|
||||
|
||||
## Disclaimer
|
||||
@@ -123,6 +129,11 @@ expect.
|
||||
|
||||
Do not hesitate to read the source code and understand the mechanism of this bot.
|
||||
|
||||
## License
|
||||
GNU General Public License v3.0 or later.
|
||||
|
||||
See [LICENSE](https://github.com/Drakkar-Software/OctoBot/blob/master/LICENSE) to see the full text.
|
||||
|
||||
## Sponsors
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
@@ -3,37 +3,32 @@ version: "3"
|
||||
services:
|
||||
octobot:
|
||||
image: drakkarsoftware/octobot:stable
|
||||
environment:
|
||||
- VIRTUAL_HOST=${HOST}
|
||||
- VIRTUAL_PORT=5001
|
||||
- SELF_SIGNED_HOST=${HOST}
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.octobot.rule=Host("${HOST}")
|
||||
- traefik.http.services.octobot.loadbalancer.server.port=${PORT}
|
||||
- traefik.http.routers.octobot.tls=true
|
||||
volumes:
|
||||
- ./logs:/octobot/logs
|
||||
- ./backtesting:/octobot/backtesting
|
||||
- ./tentacles:/octobot/tentacles
|
||||
- ./user:/octobot/user
|
||||
expose:
|
||||
- 5001
|
||||
- ${PORT}
|
||||
restart: always
|
||||
|
||||
nginx:
|
||||
image: jwilder/nginx-proxy:alpine
|
||||
traefik:
|
||||
image: traefik:v2.5
|
||||
command:
|
||||
- "--providers.docker=true"
|
||||
- "--providers.docker.exposedbydefault=false"
|
||||
- "--entrypoints.web.address=:80"
|
||||
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
|
||||
- "--entrypoints.web.http.redirections.entryPoint.scheme=https"
|
||||
- "--entrypoints.web.http.redirections.entrypoint.permanent=true"
|
||||
- "--entrypoints.websecure.address=:443"
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||
- ./ssl:/etc/nginx/certs
|
||||
- ./vhost.d:/etc/nginx/vhost.d
|
||||
restart: always
|
||||
privileged: true
|
||||
depends_on:
|
||||
- octobot
|
||||
|
||||
nginx-companion:
|
||||
container_name: proxy-companion
|
||||
restart: always
|
||||
image: sebastienheyd/self-signed-proxy-companion:latest
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- ./ssl:/etc/nginx/certs
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
|
||||
@@ -28,9 +28,9 @@ LONG_VERSION = f"{SHORT_VERSION}{PATCH_VERSION}{VERSION_DEV_PHASE}{VERSION_PHASE
|
||||
|
||||
# OctoBot urls
|
||||
OCTOBOT_WEBSITE_URL = os.getenv("OCTOBOT_ONLINE_URL", "https://www.octobot.online")
|
||||
OCTOBOT_DOCS_URL = os.getenv("DOCS_OCTOBOT_ONLINE_URL", "https://docs.octobot.online")
|
||||
EXCHANGES_DOCS_URL = os.getenv("DOCS_OCTOBOT_ONLINE_URL", "https://exchanges.docs.octobot.online/")
|
||||
DEVELOPER_DOCS_URL = os.getenv("DOCS_OCTOBOT_ONLINE_URL", "https://developer.docs.octobot.online/")
|
||||
OCTOBOT_DOCS_URL = os.getenv("DOCS_OCTOBOT_ONLINE_URL", "https://octobot.info")
|
||||
EXCHANGES_DOCS_URL = os.getenv("DOCS_OCTOBOT_ONLINE_URL", "https://exchanges.octobot.info/")
|
||||
DEVELOPER_DOCS_URL = os.getenv("DOCS_OCTOBOT_ONLINE_URL", "https://developer.octobot.info/")
|
||||
OCTOBOT_ONLINE = os.getenv("TENTACLES_OCTOBOT_ONLINE_URL", "https://static.octobot.online")
|
||||
OCTOBOT_FEEDBACK = os.getenv("FEEDBACK_OCTOBOT_ONLINE_URL", "https://feedback.octobot.online/")
|
||||
TENTACLES_REPOSITORY = "tentacles"
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
# Setup requirements
|
||||
cython==0.29.24
|
||||
cython==0.29.26
|
||||
|
||||
# Drakkar-Software requirements
|
||||
OctoBot-Commons==1.6.18
|
||||
OctoBot-Trading==1.14.2
|
||||
OctoBot-Evaluators==1.6.22
|
||||
OctoBot-Tentacles-Manager==2.6.3
|
||||
OctoBot-Services==1.2.27
|
||||
OctoBot-Backtesting==1.6.27
|
||||
Async-Channel==2.0.12
|
||||
OctoBot-Commons==1.6.20
|
||||
OctoBot-Trading==2.1.2
|
||||
OctoBot-Evaluators==1.6.24
|
||||
OctoBot-Tentacles-Manager==2.6.4
|
||||
OctoBot-Services==1.2.31
|
||||
OctoBot-Backtesting==1.6.29
|
||||
Async-Channel==2.0.13
|
||||
trading-backend==1.0.12
|
||||
|
||||
## Others
|
||||
colorlog==4.7.2
|
||||
yarl==1.6.3
|
||||
yarl==1.7.2
|
||||
idna<2.9,>=2.5
|
||||
requests==2.25.1
|
||||
|
||||
2
setup.py
2
setup.py
@@ -16,7 +16,7 @@
|
||||
import os
|
||||
from setuptools import dist
|
||||
|
||||
dist.Distribution().fetch_build_eggs(['Cython==0.29.24'])
|
||||
dist.Distribution().fetch_build_eggs(['Cython==0.29.26'])
|
||||
|
||||
try:
|
||||
from Cython.Distutils import build_ext
|
||||
|
||||
@@ -131,31 +131,31 @@ def check_portfolio(portfolio, initial_portfolio, orders, only_positivity=False)
|
||||
orders_market_amount += order.origin_quantity * order.origin_price
|
||||
else:
|
||||
orders_currency_amount += order.origin_quantity
|
||||
for symbol in portfolio:
|
||||
assert portfolio[symbol][commons_constants.PORTFOLIO_TOTAL] >= trading_constants.ZERO
|
||||
assert portfolio[symbol][commons_constants.PORTFOLIO_AVAILABLE] >= trading_constants.ZERO
|
||||
for symbol in portfolio.portfolio.keys():
|
||||
assert portfolio.get_currency_portfolio(symbol).total >= trading_constants.ZERO
|
||||
assert portfolio.get_currency_portfolio(symbol).available >= trading_constants.ZERO
|
||||
if not only_positivity:
|
||||
if order.order_type in (
|
||||
trading_enum.TraderOrderType.SELL_MARKET, trading_enum.TraderOrderType.BUY_MARKET):
|
||||
trading_enum.TraderOrderType.SELL_MARKET, trading_enum.TraderOrderType.BUY_MARKET) and \
|
||||
symbol in [order.market, order.currency]:
|
||||
# order is filled
|
||||
assert initial_portfolio[symbol][commons_constants.PORTFOLIO_TOTAL] != portfolio[symbol][
|
||||
commons_constants.PORTFOLIO_TOTAL]
|
||||
assert initial_portfolio[symbol][commons_constants.PORTFOLIO_AVAILABLE] != portfolio[symbol][
|
||||
commons_constants.PORTFOLIO_AVAILABLE]
|
||||
assert initial_portfolio.get_currency_portfolio(symbol).total != \
|
||||
portfolio.get_currency_portfolio(symbol).total
|
||||
assert initial_portfolio.get_currency_portfolio(symbol).available != \
|
||||
portfolio.get_currency_portfolio(symbol).available
|
||||
else:
|
||||
if order_symbol == symbol:
|
||||
assert initial_portfolio[symbol][commons_constants.PORTFOLIO_TOTAL] == portfolio[symbol][
|
||||
commons_constants.PORTFOLIO_TOTAL]
|
||||
assert initial_portfolio.get_currency_portfolio(symbol).total == \
|
||||
portfolio.get_currency_portfolio(symbol).total
|
||||
assert "{:f}".format(
|
||||
initial_portfolio[symbol][
|
||||
commons_constants.PORTFOLIO_AVAILABLE] - orders_currency_amount) == \
|
||||
"{:f}".format(portfolio[symbol][commons_constants.PORTFOLIO_AVAILABLE])
|
||||
initial_portfolio.get_currency_portfolio(symbol).available - orders_currency_amount) == \
|
||||
"{:f}".format(portfolio.get_currency_portfolio(symbol).available)
|
||||
elif market == symbol:
|
||||
assert initial_portfolio[market][commons_constants.PORTFOLIO_TOTAL] == portfolio[market][
|
||||
commons_constants.PORTFOLIO_TOTAL]
|
||||
assert initial_portfolio.get_currency_portfolio(market).total == \
|
||||
portfolio.get_currency_portfolio(market).total
|
||||
assert "{:f}".format(
|
||||
initial_portfolio[market][commons_constants.PORTFOLIO_AVAILABLE] - orders_market_amount) \
|
||||
== "{:f}".format(portfolio[market][commons_constants.PORTFOLIO_AVAILABLE])
|
||||
initial_portfolio.get_currency_portfolio(market).available - orders_market_amount) \
|
||||
== "{:f}".format(portfolio.get_currency_portfolio(market).available)
|
||||
|
||||
|
||||
async def fill_orders(orders, trader):
|
||||
@@ -165,6 +165,6 @@ async def fill_orders(orders, trader):
|
||||
order.filled_price = order.origin_price
|
||||
order.filled_quantity = order.origin_quantity
|
||||
await order.on_fill(force_fill=True)
|
||||
check_portfolio(trader.exchange_manager.exchange_personal_data.portfolio_manager.portfolio.portfolio,
|
||||
check_portfolio(trader.exchange_manager.exchange_personal_data.portfolio_manager.portfolio,
|
||||
None, orders, True)
|
||||
assert len(trading_api.get_open_orders(trader.exchange_manager)) == 0
|
||||
|
||||
Reference in New Issue
Block a user