Skip to content

Commit

Permalink
Merge pull request #2174 from Drakkar-Software/dev
Browse files Browse the repository at this point in the history
Master merge
  • Loading branch information
GuillaumeDSM authored Jan 2, 2023
2 parents ac0eeba + 001f072 commit 7b7c711
Show file tree
Hide file tree
Showing 118 changed files with 263 additions and 232 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ 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)*

## [0.4.33] - 2023-01-02
### Added
- Profile selector
- Login session persistence
### Updated
- Tutorials
- Mobile display

## [0.4.32] - 2022-12-29
### Fixed
- MQTT reconnection issues
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OctoBot [0.4.32](https://octobot.click/gh-changelog)
# OctoBot [0.4.33](https://octobot.click/gh-changelog)
[![PyPI](https://img.shields.io/pypi/v/OctoBot.svg)](https://octobot.click/gh-pypi)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/e07fb190156d4efb8e7d07aaa5eff2e1)](https://app.codacy.com/gh/Drakkar-Software/OctoBot?utm_source=github.com&utm_medium=referral&utm_content=Drakkar-Software/OctoBot&utm_campaign=Badge_Grade_Dashboard)[![Downloads](https://pepy.tech/badge/octobot/month)](https://pepy.tech/project/octobot)
[![Dockerhub](https://img.shields.io/docker/pulls/drakkarsoftware/octobot.svg)](https://octobot.click/gh-dockerhub)
Expand Down
2 changes: 1 addition & 1 deletion exchanges_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of OctoBot (https://github.com/Drakkar-Software/OctoBot)
# Copyright (c) 2022 Drakkar-Software, All rights reserved.
# 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
Expand Down
42 changes: 23 additions & 19 deletions exchanges_tests/abstract_authenticated_exchange_tester.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of OctoBot (https://github.com/Drakkar-Software/OctoBot)
# Copyright (c) 2022 Drakkar-Software, All rights reserved.
# 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
Expand Down Expand Up @@ -44,6 +44,7 @@ class AbstractAuthenticatedExchangeTester:
CONVERTS_ORDER_SIZE_BEFORE_PUSHING_TO_EXCHANGES = False
ORDER_PRICE_DIFF = 20 # % of price difference compared to current price for limit and stop orders
NO_FEE_ON_GET_CLOSED_ORDERS = False
OPEN_ORDERS_IN_CLOSED_ORDERS = False
MARKET_FILL_TIMEOUT = 15
CANCEL_TIMEOUT = 15
EDIT_TIMEOUT = 15
Expand All @@ -59,24 +60,6 @@ async def test_get_portfolio(self):
async def inner_test_get_portfolio(self):
self.check_portfolio_content(await self.get_portfolio())

async def test_get_my_recent_trades(self):
async with self.local_exchange_manager():
await self.inner_test_get_my_recent_trades()

async def inner_test_get_my_recent_trades(self):
trades = await self.get_my_recent_trades()
assert trades
self.check_raw_trades(trades)

async def test_get_closed_orders(self):
async with self.local_exchange_manager():
await self.inner_test_get_closed_orders()

async def inner_test_get_closed_orders(self):
orders = await self.get_closed_orders()
assert orders
self.check_raw_closed_orders(orders)

async def test_create_and_cancel_limit_orders(self):
async with self.local_exchange_manager():
await self.inner_test_create_and_cancel_limit_orders()
Expand Down Expand Up @@ -134,6 +117,24 @@ async def inner_test_create_and_cancel_stop_orders(self):
await self.wait_for_cancel(stop_loss)
assert await self.order_not_in_open_orders(open_orders, stop_loss)

async def test_get_my_recent_trades(self):
async with self.local_exchange_manager():
await self.inner_test_get_my_recent_trades()

async def inner_test_get_my_recent_trades(self):
trades = await self.get_my_recent_trades()
assert trades
self.check_raw_trades(trades)

async def test_get_closed_orders(self):
async with self.local_exchange_manager():
await self.inner_test_get_closed_orders()

async def inner_test_get_closed_orders(self):
orders = await self.get_closed_orders()
assert orders
self.check_raw_closed_orders(orders)

async def test_edit_limit_order(self):
# pass if not implemented
async with self.local_exchange_manager():
Expand Down Expand Up @@ -267,6 +268,9 @@ def check_parsed_closed_order(self, order: personal_data.Order):
assert order.side
if order.status not in (trading_enums.OrderStatus.REJECTED, trading_enums.OrderStatus.CANCELED):
assert order.origin_quantity
if self.OPEN_ORDERS_IN_CLOSED_ORDERS and order.status is trading_enums.OrderStatus.OPEN:
# when order is open, cost is not full
return
self.check_theoretical_cost(
symbols.parse_symbol(order.symbol), order.origin_quantity, order.origin_price, order.total_cost
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of OctoBot (https://github.com/Drakkar-Software/OctoBot)
# Copyright (c) 2022 Drakkar-Software, All rights reserved.
# 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
Expand Down Expand Up @@ -181,7 +181,7 @@ async def order_in_open_orders(self, previous_open_orders, order):

def check_theoretical_cost(self, symbol, quantity, price, cost):
if symbol.is_inverse():
theoretical_cost = quantity * price
else:
theoretical_cost = quantity
else:
theoretical_cost = quantity * price
assert theoretical_cost * decimal.Decimal("0.8") <= cost <= theoretical_cost * decimal.Decimal("1.2")
14 changes: 7 additions & 7 deletions exchanges_tests/test_ascendex.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of OctoBot (https://github.com/Drakkar-Software/OctoBot)
# Copyright (c) 2022 Drakkar-Software, All rights reserved.
# 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
Expand Down Expand Up @@ -34,18 +34,18 @@ class TestAscendexAuthenticatedExchange(
async def test_get_portfolio(self):
await super().test_get_portfolio()

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_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
Expand Down
14 changes: 7 additions & 7 deletions exchanges_tests/test_binance.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of OctoBot (https://github.com/Drakkar-Software/OctoBot)
# Copyright (c) 2022 Drakkar-Software, All rights reserved.
# 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
Expand Down Expand Up @@ -34,18 +34,18 @@ class TestBinanceAuthenticatedExchange(
async def test_get_portfolio(self):
await super().test_get_portfolio()

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_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
Expand Down
14 changes: 7 additions & 7 deletions exchanges_tests/test_bitget.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of OctoBot (https://github.com/Drakkar-Software/OctoBot)
# Copyright (c) 2022 Drakkar-Software, All rights reserved.
# 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
Expand Down Expand Up @@ -38,18 +38,18 @@ class TestBitgetAuthenticatedExchange(
async def test_get_portfolio(self):
await super().test_get_portfolio()

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_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
Expand Down
15 changes: 8 additions & 7 deletions exchanges_tests/test_bybit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of OctoBot (https://github.com/Drakkar-Software/OctoBot)
# Copyright (c) 2022 Drakkar-Software, All rights reserved.
# 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
Expand Down Expand Up @@ -30,16 +30,11 @@ class TestBybitAuthenticatedExchange(
SETTLEMENT_CURRENCY = "USDT"
SYMBOL = f"{ORDER_CURRENCY}/{SETTLEMENT_CURRENCY}:{SETTLEMENT_CURRENCY}"
ORDER_SIZE = 10 # % of portfolio to include in test orders
OPEN_ORDERS_IN_CLOSED_ORDERS = True

async def test_get_portfolio(self):
await super().test_get_portfolio()

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_get_empty_linear_and_inverse_positions(self):
await super().test_get_empty_linear_and_inverse_positions()

Expand All @@ -49,6 +44,12 @@ async def test_create_and_cancel_limit_orders(self):
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
await super().test_create_and_cancel_stop_orders()
Expand Down
14 changes: 7 additions & 7 deletions exchanges_tests/test_coinbasepro.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of OctoBot (https://github.com/Drakkar-Software/OctoBot)
# Copyright (c) 2022 Drakkar-Software, All rights reserved.
# 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
Expand Down Expand Up @@ -35,18 +35,18 @@ class TestCoinbaseproAuthenticatedExchange(
async def test_get_portfolio(self):
await super().test_get_portfolio()

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_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
Expand Down
14 changes: 7 additions & 7 deletions exchanges_tests/test_hollaex.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of OctoBot (https://github.com/Drakkar-Software/OctoBot)
# Copyright (c) 2022 Drakkar-Software, All rights reserved.
# 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
Expand Down Expand Up @@ -36,18 +36,18 @@ class TestHollaexAuthenticatedExchange(
async def test_get_portfolio(self):
await super().test_get_portfolio()

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_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
Expand Down
14 changes: 7 additions & 7 deletions exchanges_tests/test_huobi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of OctoBot (https://github.com/Drakkar-Software/OctoBot)
# Copyright (c) 2022 Drakkar-Software, All rights reserved.
# 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
Expand Down Expand Up @@ -35,18 +35,18 @@ class TestHuobiAuthenticatedExchange(
async def test_get_portfolio(self):
await super().test_get_portfolio()

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_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
Expand Down
14 changes: 7 additions & 7 deletions exchanges_tests/test_kucoin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of OctoBot (https://github.com/Drakkar-Software/OctoBot)
# Copyright (c) 2022 Drakkar-Software, All rights reserved.
# 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
Expand Down Expand Up @@ -34,18 +34,18 @@ class TestKucoinAuthenticatedExchange(
async def test_get_portfolio(self):
await super().test_get_portfolio()

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_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
Expand Down
Loading

0 comments on commit 7b7c711

Please sign in to comment.