From 0d5549b74007a68f9e3efcc383c05f1c9308f34b Mon Sep 17 00:00:00 2001 From: DogsTailFarmer Date: Tue, 16 Apr 2024 15:35:10 +0300 Subject: [PATCH] 3.0.5 --- CHANGELOG.md | 6 ++++++ martin_binance/__init__.py | 2 +- martin_binance/backtest/optimizer.py | 3 +-- martin_binance/executor.py | 7 ++++--- martin_binance/params.py | 15 ++++++++++++++- martin_binance/strategy_base.py | 8 ++++---- pyproject.toml | 2 +- requirements.txt | 2 +- 8 files changed, 32 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eaddc97..ac6b26d 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 3.0.5 - 2024-04-16 +### Update +* Up requirements for exchanges-wrapper==2.1.10 +* Import from `params` module +* Some issues `Mismatch between signature and use of an overridden method` + ## 3.0.4 - 2024-04-14 ### Fix * Creating and manage asynchronous tasks diff --git a/martin_binance/__init__.py b/martin_binance/__init__.py index 43afad9..446a093 100755 --- a/martin_binance/__init__.py +++ b/martin_binance/__init__.py @@ -6,7 +6,7 @@ __author__ = "Jerry Fedorenko" __copyright__ = "Copyright © 2021 Jerry Fedorenko aka VM" __license__ = "MIT" -__version__ = "3.0.4" +__version__ = "3.0.5" __maintainer__ = "Jerry Fedorenko" __contact__ = "https://github.com/DogsTailFarmer" diff --git a/martin_binance/backtest/optimizer.py b/martin_binance/backtest/optimizer.py index 66a5359..c666fcd 100755 --- a/martin_binance/backtest/optimizer.py +++ b/martin_binance/backtest/optimizer.py @@ -6,12 +6,11 @@ __author__ = "Jerry Fedorenko" __copyright__ = "Copyright © 2024 Jerry Fedorenko aka VM" __license__ = "MIT" -__version__ = "3.0.4" +__version__ = "3.0.5" __maintainer__ = "Jerry Fedorenko" __contact__ = "https://github.com/DogsTailFarmer" -import asyncio import importlib.util as iu import logging.handlers import stat diff --git a/martin_binance/executor.py b/martin_binance/executor.py index ef5c830..e32eda9 100755 --- a/martin_binance/executor.py +++ b/martin_binance/executor.py @@ -4,15 +4,16 @@ __author__ = "Jerry Fedorenko" __copyright__ = "Copyright © 2021 Jerry Fedorenko aka VM" __license__ = "MIT" -__version__ = "3.0.3" +__version__ = "3.0.5" __maintainer__ = "Jerry Fedorenko" __contact__ = 'https://github.com/DogsTailFarmer' ################################################################## +import logging import sys import gc import statistics import traceback -from decimal import ROUND_HALF_EVEN, ROUND_FLOOR, ROUND_CEILING, ROUND_HALF_DOWN, ROUND_HALF_UP +from decimal import Decimal, ROUND_HALF_EVEN, ROUND_FLOOR, ROUND_CEILING, ROUND_HALF_DOWN, ROUND_HALF_UP from threading import Thread import queue import math @@ -132,7 +133,7 @@ def __init__(self, call_super=True): schedule.every(10).seconds.do(self.event_get_command_tlg) schedule.every(6).seconds.do(self.event_report) - def init(self, check_funds=True) -> None: # skipcq: PYL-W0221 + def init(self, check_funds=True) -> None: self.message_log('Start Init section') if COLLECT_ASSETS and GRID_ONLY: init_params_error = 'COLLECT_ASSETS and GRID_ONLY: one only allowed' diff --git a/martin_binance/params.py b/martin_binance/params.py index 987878f..9a7c583 100644 --- a/martin_binance/params.py +++ b/martin_binance/params.py @@ -4,7 +4,7 @@ __author__ = "Jerry Fedorenko" __copyright__ = "Copyright © 2021 Jerry Fedorenko aka VM" __license__ = "MIT" -__version__ = "3.0.1" +__version__ = "3.0.5" __maintainer__ = "Jerry Fedorenko" __contact__ = "https://github.com/DogsTailFarmer" @@ -12,6 +12,19 @@ from decimal import Decimal from pathlib import Path +__all__ = [ + 'SYMBOL', 'EXCHANGE', 'ID_EXCHANGE', 'FEE_MAKER', 'FEE_TAKER', 'FEE_FIRST', 'FEE_SECOND', 'GRID_MAX_COUNT', + 'START_ON_BUY', 'AMOUNT_FIRST', 'USE_ALL_FUND', 'AMOUNT_SECOND', 'PRICE_SHIFT', 'PRICE_LIMIT_RULES', + 'ROUND_BASE', 'ROUND_QUOTE', 'PROFIT', 'PROFIT_MAX', 'OVER_PRICE', 'ORDER_Q', 'MARTIN', 'SHIFT_GRID_DELAY', + 'GRID_UPDATE_INTERVAL', 'STATUS_DELAY', 'GRID_ONLY', 'LOG_LEVEL', 'HOLD_TP_ORDER_TIMEOUT', 'COLLECT_ASSETS', + 'GRID_ONLY_DELAY', 'ADAPTIVE_TRADE_CONDITION', 'BB_CANDLE_SIZE_IN_MINUTES', 'BB_NUMBER_OF_CANDLES', 'KBB', + 'LINEAR_GRID_K', 'ADX_CANDLE_SIZE_IN_MINUTES', 'ADX_NUMBER_OF_CANDLES', 'ADX_PERIOD', 'ADX_THRESHOLD', + 'ADX_PRICE_THRESHOLD', 'REVERSE', 'REVERSE_TARGET_AMOUNT', 'REVERSE_INIT_AMOUNT', 'REVERSE_STOP', + 'HEAD_VERSION', 'LOAD_LAST_STATE', 'LAST_STATE_FILE', 'VPS_NAME', 'PARAMS', 'TELEGRAM_URL', 'TOKEN', + 'CHANNEL_ID', 'STOP_TLG', 'INLINE_BOT', 'MODE', 'XTIME', 'SAVE_DS', 'SAVE_PERIOD', 'LOGGING', 'SELF_OPTIMIZATION', + 'N_TRIALS', 'SESSION_RESULT' +] + SYMBOL = str() EXCHANGE = () # Exchange setup diff --git a/martin_binance/strategy_base.py b/martin_binance/strategy_base.py index 65214ae..46f08da 100644 --- a/martin_binance/strategy_base.py +++ b/martin_binance/strategy_base.py @@ -1624,7 +1624,7 @@ async def main(self, _symbol): ) [self.trades.append(PrivateTrade(trade)) for trade in load_from_csv()] # - self.restore_strategy_state(last_state, restore=False) + self.restore_strategy_state(strategy_state=last_state, restore=False) # self.init(check_funds=False) else: @@ -1716,7 +1716,7 @@ def get_sum_profit(self): raise NotImplementedError @abstractmethod - def get_free_assets(self, *args, **kwargs): + def get_free_assets(self, **kwargs): raise NotImplementedError @abstractmethod @@ -1724,7 +1724,7 @@ def on_new_order_book(self, *args): raise NotImplementedError @abstractmethod - def restore_strategy_state(self, *args, **kwargs): + def restore_strategy_state(self, **kwargs): raise NotImplementedError @abstractmethod @@ -1732,7 +1732,7 @@ def start(self, *args): raise NotImplementedError @abstractmethod - def init(self, *args, **kwargs): + def init(self, **kwargs): raise NotImplementedError @abstractmethod diff --git a/pyproject.toml b/pyproject.toml index 33c86c5..1174ebc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ dynamic = ["version", "description"] requires-python = ">=3.9" dependencies = [ - "exchanges-wrapper==2.1.9", + "exchanges-wrapper==2.1.10", "jsonpickle==3.0.2", "psutil==5.9.6", "requests==2.31.0", diff --git a/requirements.txt b/requirements.txt index c33e57f..67d2884 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -exchanges-wrapper==2.1.9 +exchanges-wrapper==2.1.10 jsonpickle==3.0.2 psutil==5.9.6 requests==2.31.0