From ad2bb3ba273d1ab8b479f358916ec782750c3e17 Mon Sep 17 00:00:00 2001 From: VladKochetov007 Date: Thu, 18 Nov 2021 00:11:47 +0200 Subject: [PATCH] debug --- quick_trade/trading_sys.py | 12 ++++++++---- quick_trade/utils.py | 2 +- setup.py | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/quick_trade/trading_sys.py b/quick_trade/trading_sys.py index 4fe7b0df..0cba855a 100644 --- a/quick_trade/trading_sys.py +++ b/quick_trade/trading_sys.py @@ -937,10 +937,14 @@ def get_trading_predict(self, bet_for_trading_on_client: Union[float, int] = np.inf, ) -> Dict[str, Union[str, float]]: balance = self.client.get_balance(self.ticker.split('/')[1]) - bet = (balance * 10) / (can_orders / deposit_part - TradingClient.cls_open_orders) - bet /= 10 # decimal analog - if bet > bet_for_trading_on_client_copy: - bet = bet_for_trading_on_client_copy + bet = bet_for_trading_on_client_copy + if bet_for_trading_on_client is not np.inf: + if TradingClient.cls_open_orders != can_orders: + bet = (balance * 10) / (can_orders / deposit_part - TradingClient.cls_open_orders) + bet /= 10 # decimal analog + self.__prev_bet = bet + else: + bet = self.__prev_bet return super().get_trading_predict(bet_for_trading_on_client=bet) def start_trading(pair, strat): diff --git a/quick_trade/utils.py b/quick_trade/utils.py index ac6efb86..187c3fb5 100644 --- a/quick_trade/utils.py +++ b/quick_trade/utils.py @@ -172,7 +172,7 @@ calmar ratio: {} max drawdown: {}%""" # .format(Trader.losses, Trader.trades, ...) -__version__: str = "6.9.7" +__version__: str = "6.9.8" __author__: str = 'Vlad Kochetov' __credits__: List[str] = [ "Hemerson Tacon -- Stack overflow", diff --git a/setup.py b/setup.py index 550558ca..778b3c57 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ with open('README.md') as file: long_desc = file.read() -__version__ = "6.9.7" +__version__ = "6.9.8" setup( name='quick_trade',