From 72d167f08d8dbac6b02a906f3f512c7e16bd8566 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Wed, 10 Jan 2024 23:40:57 +0100 Subject: [PATCH 1/6] [Links] update blog links --- CHANGELOG.md | 2 +- octobot/community/models/strategy_data.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c5c10912..ff39af27f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,7 +80,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.0.0] - 2023-09-26 ### Updated -- [Community] Migrate to the updated octobot.cloud. Full details on https://www.octobot.cloud/blog/introducing-the-new-octobot-cloud +- [Community] Migrate to the updated octobot.cloud. Full details on https://www.octobot.cloud/en/blog/introducing-the-new-octobot-cloud - [Logs] Improve debug logs ### Fixed - [GridTrading] Mirror order rebalance issues diff --git a/octobot/community/models/strategy_data.py b/octobot/community/models/strategy_data.py index 4aa2d5bc8..9575023f9 100644 --- a/octobot/community/models/strategy_data.py +++ b/octobot/community/models/strategy_data.py @@ -31,7 +31,7 @@ def get_url(self) -> str: external_links = self.metadata.get("external_link") if external_links: if blog_slug := external_links.get("blog"): - return f"{identifiers_provider.IdentifiersProvider.COMMUNITY_LANDING_URL}/blog/{blog_slug}" + return f"{identifiers_provider.IdentifiersProvider.COMMUNITY_LANDING_URL}/en/blog/{blog_slug}" return "" From e5ac4c16dd544a9d6a4866e38b80162c8e0650ce Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Thu, 18 Jan 2024 11:37:06 +0100 Subject: [PATCH 2/6] [Requirements] bump --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 304ca11e7..76cbb0587 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ # Drakkar-Software requirements OctoBot-Commons==1.9.37 -OctoBot-Trading==2.4.49 +OctoBot-Trading==2.4.50 OctoBot-Evaluators==1.9.4 OctoBot-Tentacles-Manager==2.9.8 OctoBot-Services==1.6.10 From 3de75b5d95cd71321a3f80bff3668cc8d7f94496 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Thu, 18 Jan 2024 14:20:03 +0100 Subject: [PATCH 3/6] [Exchanges] add CoinEx tests --- .../abstract_authenticated_exchange_tester.py | 11 ++- .../exchanges_tests/test_coinex.py | 75 +++++++++++++++++++ requirements.txt | 6 +- 3 files changed, 85 insertions(+), 7 deletions(-) create mode 100644 additional_tests/exchanges_tests/test_coinex.py diff --git a/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py b/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py index fbb31fc2b..c724069a2 100644 --- a/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py +++ b/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py @@ -151,10 +151,13 @@ async def inner_test_create_and_cancel_limit_orders(self, symbol=None, settlemen # # end debug tools open_orders = await self.get_open_orders(exchange_data) buy_limit = await self.create_limit_order(price, size, trading_enums.TradeOrderSide.BUY, symbol=symbol) - self.check_created_limit_order(buy_limit, price, size, trading_enums.TradeOrderSide.BUY) - assert await self.order_in_open_orders(open_orders, buy_limit, symbol=symbol) - await self.check_can_get_order(buy_limit) - await self.cancel_order(buy_limit) + try: + self.check_created_limit_order(buy_limit, price, size, trading_enums.TradeOrderSide.BUY) + assert await self.order_in_open_orders(open_orders, buy_limit, symbol=symbol) + await self.check_can_get_order(buy_limit) + finally: + # don't leave buy_limit as open order + await self.cancel_order(buy_limit) assert await self.order_not_in_open_orders(open_orders, buy_limit, symbol=symbol) async def test_create_and_fill_market_orders(self): diff --git a/additional_tests/exchanges_tests/test_coinex.py b/additional_tests/exchanges_tests/test_coinex.py new file mode 100644 index 000000000..e2e50759f --- /dev/null +++ b/additional_tests/exchanges_tests/test_coinex.py @@ -0,0 +1,75 @@ +# This file is part of OctoBot (https://github.com/Drakkar-Software/OctoBot) +# Copyright (c) 2023 Drakkar-Software, All rights reserved. +# +# OctoBot is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either +# version 3.0 of the License, or (at your option) any later version. +# +# OctoBot is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with OctoBot. If not, see . +import pytest + +from additional_tests.exchanges_tests import abstract_authenticated_exchange_tester + +# All test coroutines will be treated as marked. +pytestmark = pytest.mark.asyncio + + +class TestCoinExAuthenticatedExchange( + abstract_authenticated_exchange_tester.AbstractAuthenticatedExchangeTester +): + # enter exchange name as a class variable here + EXCHANGE_NAME = "coinex" + ORDER_CURRENCY = "BTC" + SETTLEMENT_CURRENCY = "USDT" + SYMBOL = f"{ORDER_CURRENCY}/{SETTLEMENT_CURRENCY}" + ORDER_SIZE = 70 # % of portfolio to include in test orders + CONVERTS_ORDER_SIZE_BEFORE_PUSHING_TO_EXCHANGES = True + + async def test_get_portfolio(self): + await super().test_get_portfolio() + + async def test_get_portfolio_with_market_filter(self): + await super().test_get_portfolio_with_market_filter() + + async def test_get_account_id(self): + # pass if not implemented + pass + + async def test_create_and_cancel_limit_orders(self): + await super().test_create_and_cancel_limit_orders() + + async def test_create_and_fill_market_orders(self): + await super().test_create_and_fill_market_orders() + + async def test_get_my_recent_trades(self): + await super().test_get_my_recent_trades() + + async def test_get_closed_orders(self): + await super().test_get_closed_orders() + + async def test_create_and_cancel_stop_orders(self): + # pass if not implemented + pass + + async def test_edit_limit_order(self): + # pass if not implemented + pass + + async def test_edit_stop_order(self): + # pass if not implemented + pass + + async def test_create_single_bundled_orders(self): + # pass if not implemented + pass + + async def test_create_double_bundled_orders(self): + # pass if not implemented + pass diff --git a/requirements.txt b/requirements.txt index 76cbb0587..246a118b3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,12 @@ # Drakkar-Software requirements OctoBot-Commons==1.9.37 -OctoBot-Trading==2.4.50 +OctoBot-Trading==2.4.51 OctoBot-Evaluators==1.9.4 -OctoBot-Tentacles-Manager==2.9.8 +OctoBot-Tentacles-Manager==2.9.9 OctoBot-Services==1.6.10 OctoBot-Backtesting==1.9.7 Async-Channel==2.2.1 -trading-backend==1.2.12 +trading-backend==1.2.13 ## Others colorlog==6.8.0 From ae5fae63832a062133466260c60cb7202b9d08f7 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Thu, 18 Jan 2024 14:37:15 +0100 Subject: [PATCH 4/6] [Logger] use info to log system details --- octobot/cli.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/octobot/cli.py b/octobot/cli.py index 2507a32ca..53226c630 100644 --- a/octobot/cli.py +++ b/octobot/cli.py @@ -94,9 +94,9 @@ def _disable_interface_from_param(interface_identifier, param_value, logger): def _log_environment(logger): try: bot_type = "cloud" if constants.IS_CLOUD_ENV else "self-hosted" - logger.debug(f"Running {bot_type} OctoBot on {os_util.get_current_platform()} " - f"with {os_util.get_octobot_type()} " - f"[Python {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}]") + logger.info(f"Running {bot_type} OctoBot on {os_util.get_current_platform()} " + f"with {os_util.get_octobot_type()} " + f"[Python {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}]") except Exception as e: logger.error(f"Impossible to identify the current running environment: {e}") From fdfb011dce03d3d43fa098e6d2704d21007c3591 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Thu, 18 Jan 2024 15:12:32 +0100 Subject: [PATCH 5/6] [Version] v1.0.7 --- CHANGELOG.md | 9 +++++++++ README.md | 2 +- octobot/__init__.py | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff39af27f..0880dd506 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 *It is strongly advised to perform an update of your tentacles after updating OctoBot. (start.py tentacles --install --all)* +## [1.0.7] - 2024-01-18 +### Added +- [CoinEx] Support CoinEx +### Updated +- [WebInterface] Show profitability even on backtesting error, special thanks to Phodia for this improvement. +### Fixed +- [Exchanges] Websocket reconnection issues +- [DailyTradingMode] Fix sell amount when shorting in Target Profits mode + ## [1.0.6] - 2024-01-09 ### Added - [TradingModes] Improved documentation and added links to full guides diff --git a/README.md b/README.md index 69b34c931..c217fc246 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# OctoBot [1.0.6](https://octobot.click/gh-changelog) +# OctoBot [1.0.7](https://octobot.click/gh-changelog) [![PyPI](https://img.shields.io/pypi/v/OctoBot.svg?logo=pypi)](https://octobot.click/gh-pypi) [![Downloads](https://pepy.tech/badge/octobot/month)](https://pepy.tech/project/octobot) [![Dockerhub](https://img.shields.io/docker/pulls/drakkarsoftware/octobot.svg?logo=docker)](https://octobot.click/gh-dockerhub) diff --git a/octobot/__init__.py b/octobot/__init__.py index c25b9213e..427693369 100644 --- a/octobot/__init__.py +++ b/octobot/__init__.py @@ -16,5 +16,5 @@ PROJECT_NAME = "OctoBot" AUTHOR = "Drakkar-Software" -VERSION = "1.0.6" # major.minor.revision +VERSION = "1.0.7" # major.minor.revision LONG_VERSION = f"{VERSION}" From fadb846fe162eb7b2aef04bd7aa8ab7b4e66771c Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Thu, 18 Jan 2024 17:05:04 +0100 Subject: [PATCH 6/6] [Requirements] bump --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 246a118b3..be3e1ef79 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # Drakkar-Software requirements -OctoBot-Commons==1.9.37 +OctoBot-Commons==1.9.39 OctoBot-Trading==2.4.51 OctoBot-Evaluators==1.9.4 OctoBot-Tentacles-Manager==2.9.9