Skip to content

Commit 66b287e

Browse files
authored
Merge pull request #2305 from Drakkar-Software/dev
Master merge
2 parents 2bf00f5 + b3d421d commit 66b287e

File tree

13 files changed

+50
-20
lines changed

13 files changed

+50
-20
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
*It is strongly advised to perform an update of your tentacles after updating OctoBot. (start.py tentacles --install --all)*
88

9+
## [0.4.47] - 2023-04-02
10+
### Added
11+
- [Evaluators] ChatGPT evaluator
12+
- [Exchanges] Restore Coinbase support
13+
- [Profiles] Risk and complexity
14+
### Updated
15+
- [WebInterface] Improve candle charts display. Special thanks to Tim !
16+
- [Services] Telegram, flask, reddit and other connectors versions
17+
### Fixed
18+
- [OKX] create order issues
19+
- [WebInterface] Fix unexpected client disconnections
20+
- [PNL] invalid trades PNL related issues
21+
22+
923
## [0.4.46] - 2023-03-24
1024
### Updated
1125
- [Telegram] portfolio display

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# OctoBot [0.4.46](https://octobot.click/gh-changelog)
1+
# OctoBot [0.4.47](https://octobot.click/gh-changelog)
22
[![PyPI](https://img.shields.io/pypi/v/OctoBot.svg?logo=pypi)](https://octobot.click/gh-pypi)
33
[![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)
44
[![Downloads](https://pepy.tech/badge/octobot/month)](https://pepy.tech/project/octobot)

exchanges_tests/abstract_authenticated_exchange_tester.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ async def inner_test_create_and_fill_market_orders(self):
100100
price = self.get_order_price(current_price, False)
101101
size = self.get_order_size(portfolio, price)
102102
buy_market = await self.create_market_order(current_price, size, trading_enums.TradeOrderSide.BUY)
103-
self.check_created_market_order(buy_market, size, trading_enums.TradeOrderSide.BUY)
104103
post_buy_portfolio = {}
105104
try:
105+
self.check_created_market_order(buy_market, size, trading_enums.TradeOrderSide.BUY)
106106
filled_order = await self.wait_for_fill(buy_market)
107107
await self.check_require_order_fees_from_trades(
108108
filled_order[trading_enums.ExchangeConstantsOrderColumns.ID.value]
@@ -568,6 +568,8 @@ async def create_market_order(self, current_price, size, side, symbol=None,
568568

569569
async def create_order(self, price, current_price, size, side, order_type,
570570
symbol=None, push_on_exchange=True):
571+
if size == trading_constants.ZERO:
572+
raise AssertionError(f"Trying to create and order with a size of {size}")
571573
current_order = personal_data.create_order_instance(
572574
self.exchange_manager.trader,
573575
order_type=order_type,
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,16 @@
2121
pytestmark = pytest.mark.asyncio
2222

2323

24-
class TestCoinbaseproAuthenticatedExchange(
24+
class TestCoinbaseAuthenticatedExchange(
2525
abstract_authenticated_exchange_tester.AbstractAuthenticatedExchangeTester
2626
):
27-
# BROKEN: waiting for ccxt update on coinbase advanced
28-
2927
# enter exchange name as a class variable here
30-
EXCHANGE_NAME = "coinbasepro"
31-
EXCHANGE_TENTACLE_NAME = "CoinbasePro"
32-
ORDER_CURRENCY = "BTC"
33-
SETTLEMENT_CURRENCY = "USD"
28+
EXCHANGE_NAME = "coinbase"
29+
ORDER_CURRENCY = "ADA"
30+
SETTLEMENT_CURRENCY = "BTC"
3431
SYMBOL = f"{ORDER_CURRENCY}/{SETTLEMENT_CURRENCY}"
35-
ORDER_SIZE = 50 # % of portfolio to include in test orders
32+
ORDER_SIZE = 20 # % of portfolio to include in test orders
33+
CONVERTS_ORDER_SIZE_BEFORE_PUSHING_TO_EXCHANGES = True
3634

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

octobot/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616

1717
PROJECT_NAME = "OctoBot"
1818
AUTHOR = "Drakkar-Software"
19-
VERSION = "0.4.46" # major.minor.revision
19+
VERSION = "0.4.47" # major.minor.revision
2020
LONG_VERSION = f"{VERSION}"

octobot/api/backtesting.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def create_independent_backtesting(config,
2525
run_on_common_part_only=True,
2626
start_timestamp=None,
2727
end_timestamp=None,
28+
portfolio=None,
2829
enable_logs=True,
2930
stop_when_finished=False,
3031
enforce_total_databases_max_size_after_run=True,
@@ -39,6 +40,7 @@ def create_independent_backtesting(config,
3940
join_backtesting_timeout=join_backtesting_timeout,
4041
start_timestamp=start_timestamp,
4142
end_timestamp=end_timestamp,
43+
portfolio=portfolio,
4244
enable_logs=enable_logs,
4345
stop_when_finished=stop_when_finished,
4446
enforce_total_databases_max_size_after_run=enforce_total_databases_max_size_after_run,

octobot/backtesting/independent_backtesting.pxd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ cdef class IndependentBacktesting:
3838
cdef public dict symbols_to_create_exchange_classes
3939
cdef public double risk
4040
cdef public dict starting_portfolio
41+
cdef public dict input_portfolio
4142
cdef public dict fees_config
4243
cdef public bint stopped
4344

octobot/backtesting/independent_backtesting.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def __init__(self, config,
5151
join_backtesting_timeout=backtesting_constants.BACKTESTING_DEFAULT_JOIN_TIMEOUT,
5252
start_timestamp=None,
5353
end_timestamp=None,
54+
portfolio=None,
5455
enable_logs=True,
5556
stop_when_finished=False,
5657
enforce_total_databases_max_size_after_run=True,
@@ -66,6 +67,7 @@ def __init__(self, config,
6667
self.symbols_to_create_exchange_classes = {}
6768
self.risk = 0.1
6869
self.starting_portfolio = {}
70+
self.input_portfolio = portfolio
6971
self.fees_config = {}
7072
self.forced_time_frames = []
7173
self.optimizer_id = None
@@ -216,8 +218,10 @@ async def _register_available_data(self):
216218
def _init_default_config_values(self):
217219
self.risk = copy.deepcopy(self.octobot_origin_config[common_constants.CONFIG_TRADING][
218220
common_constants.CONFIG_TRADER_RISK])
219-
self.starting_portfolio = copy.deepcopy(self.octobot_origin_config[common_constants.CONFIG_SIMULATOR][
220-
common_constants.CONFIG_STARTING_PORTFOLIO])
221+
self.starting_portfolio = copy.deepcopy(
222+
self.input_portfolio or
223+
self.octobot_origin_config[common_constants.CONFIG_SIMULATOR][common_constants.CONFIG_STARTING_PORTFOLIO]
224+
)
221225
self.fees_config = copy.deepcopy(self.octobot_origin_config[common_constants.CONFIG_SIMULATOR][
222226
common_constants.CONFIG_SIMULATOR_FEES])
223227
if evaluator_constants.CONFIG_FORCED_TIME_FRAME in self.octobot_origin_config:

octobot/backtesting/octobot_backtesting.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ def check_remaining_objects(self):
223223
exchanges.ExchangeSimulator: exchanges_count,
224224
exchange_data.OHLCVUpdaterSimulator: exchanges_count
225225
}
226+
# trigger garbage collector to get a fresh memory picture
227+
gc.collect()
226228
for obj in gc.get_objects():
227229
if isinstance(obj, to_watch_objects):
228230
if isinstance(obj, exchanges.ExchangeManager) and not obj.is_initialized:

octobot/config/profile_schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
"origin_url": {
2323
"type": ["string", "null"]
2424
},
25+
"complexity": {
26+
"type": "number"
27+
},
28+
"risk": {
29+
"type": "number"
30+
},
2531
"read_only": {
2632
"type": "boolean"
2733
}

0 commit comments

Comments
 (0)