From ab32cd2d7ee49e3fa496e153921b3be24e6c49f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 12 May 2025 10:49:42 +0200 Subject: [PATCH] fix(qav3): ensure bounds are initialized at entry confirmation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- quickadapter/user_data/strategies/QuickAdapterV3.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/quickadapter/user_data/strategies/QuickAdapterV3.py b/quickadapter/user_data/strategies/QuickAdapterV3.py index c9cc79c..fb7fc07 100644 --- a/quickadapter/user_data/strategies/QuickAdapterV3.py +++ b/quickadapter/user_data/strategies/QuickAdapterV3.py @@ -635,8 +635,7 @@ class QuickAdapterV3(IStrategy): side: str, **kwargs, ) -> bool: - open_trade_count = Trade.get_open_trade_count() - if open_trade_count >= self.config.get("max_open_trades"): + if Trade.get_open_trade_count() >= self.config.get("max_open_trades"): return False max_open_trades_per_side = self.max_open_trades_per_side() if max_open_trades_per_side >= 0: @@ -655,8 +654,9 @@ class QuickAdapterV3(IStrategy): last_candle_natr = last_candle["natr_label_period_candles"] if isna(last_candle_natr) or last_candle_natr < 0: return False - entry_natr_ratio = self.get_entry_natr_ratio(pair) - price_deviation = last_candle_natr * entry_natr_ratio + lower_bound = 0 + upper_bound = 0 + price_deviation = last_candle_natr * self.get_entry_natr_ratio(pair) if side == "long": lower_bound = last_candle_low * (1 - price_deviation) upper_bound = last_candle_close * (1 + price_deviation) -- 2.43.0