From 34f123bcf092064885f6bb01ca6a1cddeda4a0d4 Mon Sep 17 00:00:00 2001 From: ddrwode <34234@3来 34> Date: Mon, 9 Mar 2026 14:26:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E4=B8=80=E4=B8=AA=E5=9B=9E?= =?UTF-8?q?=E6=B5=8B=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- job_bitmart.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/job_bitmart.py b/job_bitmart.py index d81f99c..028e1e2 100644 --- a/job_bitmart.py +++ b/job_bitmart.py @@ -550,8 +550,10 @@ class BBDelayReversalTrader: # 5. 极值更新与半仓/延迟全平反手逻辑 if self.position == 1 and self.open_avg_price: - if self.highest_since_open is None or current_price > self.highest_since_open: - self.highest_since_open = current_price + # 记录持有期内的最高价 (包含当前实时价和当前K线最高价) + current_max = max(current_price, cur_high) + if self.highest_since_open is None or current_max > self.highest_since_open: + self.highest_since_open = current_max # 延迟平仓逻辑: 之前触碰过上轨 if self.touched_band_price is not None: @@ -632,8 +634,10 @@ class BBDelayReversalTrader: continue elif self.position == -1 and self.open_avg_price: - if self.lowest_since_open is None or current_price < self.lowest_since_open: - self.lowest_since_open = current_price + # 记录持有期内的最低价 (包含当前实时价和当前K线最低价) + current_min = min(current_price, cur_low) + if self.lowest_since_open is None or current_min < self.lowest_since_open: + self.lowest_since_open = current_min # 延迟平仓逻辑: 之前触碰过下轨 if self.touched_band_price is not None: