From 91792e49c53dfbd023e3ef205db614ca2c6cf7ce Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 17 Jul 2025 23:54:46 +0200 Subject: [PATCH] perf(qav3): use last candle WCL at trade 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/quickadapter/user_data/strategies/QuickAdapterV3.py b/quickadapter/user_data/strategies/QuickAdapterV3.py index e746495..a514d90 100644 --- a/quickadapter/user_data/strategies/QuickAdapterV3.py +++ b/quickadapter/user_data/strategies/QuickAdapterV3.py @@ -851,6 +851,9 @@ class QuickAdapterV3(IStrategy): last_candle_close = last_candle.get("close") last_candle_high = last_candle.get("high") last_candle_low = last_candle.get("low") + last_candle_weighted_close_price = ( + last_candle_high + last_candle_low + 2 * last_candle_close + ) / 4.0 last_candle_natr = last_candle.get("natr_label_period_candles") if isna(last_candle_natr) or last_candle_natr < 0: return False @@ -859,9 +862,9 @@ class QuickAdapterV3(IStrategy): price_deviation = (last_candle_natr / 100.0) * 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) + upper_bound = last_candle_weighted_close_price * (1 + price_deviation) elif side == "short": - lower_bound = last_candle_close * (1 - price_deviation) + lower_bound = last_candle_weighted_close_price * (1 - price_deviation) upper_bound = last_candle_high * (1 + price_deviation) if lower_bound < 0: logger.info( -- 2.43.0