From 795e32ed4e236f13b29fe1b37447769ca0133899 Mon Sep 17 00:00:00 2001 From: Vladimir Kamarzin Date: Mon, 22 Apr 2019 16:03:42 +0500 Subject: [PATCH] Fix conditional expressions logic Closes: #567 --- dexbot/strategies/base.py | 4 ++-- dexbot/strategies/staggered_orders.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dexbot/strategies/base.py b/dexbot/strategies/base.py index fbc37d7a3..b84d76244 100644 --- a/dexbot/strategies/base.py +++ b/dexbot/strategies/base.py @@ -1156,14 +1156,14 @@ def calc_profit(self): old_center_price = old_data.center_price center_price = self.get_market_center_price() - if not (old_center_price or center_price): + if not old_center_price or not center_price: return profit # Calculate max theoretical balances based on starting price old_max_quantity_base = earlier_base + earlier_quote * old_center_price old_max_quantity_quote = earlier_quote + earlier_base / old_center_price - if not (old_max_quantity_base or old_max_quantity_quote): + if not old_max_quantity_base or not old_max_quantity_quote: return profit # Current balances diff --git a/dexbot/strategies/staggered_orders.py b/dexbot/strategies/staggered_orders.py index 74e9402e2..ab5cd94f3 100644 --- a/dexbot/strategies/staggered_orders.py +++ b/dexbot/strategies/staggered_orders.py @@ -154,11 +154,11 @@ def maintain_strategy(self, *args, **kwargs): self.store_profit_estimation_data() # Calculate minimal orders amounts based on asset precision - if not (self.order_min_base or self.order_min_quote): + if not self.order_min_base or not self.order_min_quote: self.calculate_min_amounts() # Calculate asset thresholds once - if not (self.quote_asset_threshold or self.base_asset_threshold): + if not self.quote_asset_threshold or not self.base_asset_threshold: self.calculate_asset_thresholds() # Remove orders that exceed boundaries