From abe663e1a6f1a8926f648c81972556067a3c565c Mon Sep 17 00:00:00 2001 From: jackyu66git Date: Sat, 25 Oct 2025 00:08:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AC=94=E4=B8=AD=E6=9E=A2bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChanSEG.py | 4 ++-- web/templates/index.html | 26 ++++++++++---------------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/ChanSEG.py b/ChanSEG.py index ba0adfc..4cb8e75 100644 --- a/ChanSEG.py +++ b/ChanSEG.py @@ -96,7 +96,7 @@ class ChanSEG(): for index in range(1, len(self.bi_list)): bi = self.bi_list[index] if len(zs_list) == 0 or (last_zs and last_zs.is_sure): - if bi.next and bi.next.next and bi.next.next.is_sure and bi.check_bi_zs_overlap() and bi.dir == Chan_BI_DIR.DOWN: + if bi.next and bi.next.next and bi.next.next.is_sure and bi.next.next.index <= self.bi_list[-1].index and bi.check_bi_zs_overlap() and bi.dir == Chan_BI_DIR.DOWN: zg = min(bi.high, bi.next.high, bi.next.next.high) zd = max(bi.low, bi.next.low, bi.next.next.low) gg = max(bi.high, bi.next.high, bi.next.next.high) @@ -135,7 +135,7 @@ class ChanSEG(): for index in range(1, len(self.bi_list)): bi = self.bi_list[index] if len(zs_list) == 0 or (last_zs and last_zs.is_sure): - if bi.next and bi.next.next and bi.next.next.is_sure and bi.check_bi_zs_overlap() and bi.dir == Chan_BI_DIR.UP: + if bi.next and bi.next.next and bi.next.next.is_sure and bi.next.next.index <= self.bi_list[-1].index and bi.check_bi_zs_overlap() and bi.dir == Chan_BI_DIR.UP: zg = min(bi.high, bi.next.high, bi.next.next.high) zd = max(bi.low, bi.next.low, bi.next.next.low) gg = max(bi.high, bi.next.high, bi.next.next.high) diff --git a/web/templates/index.html b/web/templates/index.html index 3387496..f9b71bd 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -2726,6 +2726,14 @@ hasKlineData: !!currentData.kline_data, isArray: Array.isArray(currentData.kline_data) }); + // 在创建 ChanMACD 前,确保一次性同步 U 显示开关到全局(默认不显示) + if (typeof window.showUOnMain === 'undefined') { + window.showUOnMain = $('#toggleUOnMain').is(':checked'); + } + if (typeof window.showUOnElement === 'undefined') { + window.showUOnElement = $('#toggleUOnElement').is(':checked'); + } + if (showMacd && chanMacdChart && ((useElementPeriod && currentData.element_macd) || currentData.macd) && (useElementPeriod ? currentData.element_kline_data : currentData.kline_data)) { console.log('✅ 开始创建 ChanMACD 系列'); // 创建ChanMACD线系列 @@ -2990,7 +2998,7 @@ (currentData.element_macd || currentData.macd), (currentData.element_kline_data || currentData.kline_data) ); - if ((typeof window.showUOnMain === 'undefined' ? true : window.showUOnMain) && Array.isArray(mainCmAll.klu_list)) { + if ((typeof window.showUOnMain === 'undefined' ? false : window.showUOnMain) && Array.isArray(mainCmAll.klu_list)) { mainCmAll.klu_list.forEach((item) => { if (!item || !item.time) return; const ts = Math.floor(new Date(item.time).getTime() / 1000); @@ -3010,7 +3018,7 @@ } }); } - if ((typeof window.showUOnElement === 'undefined' ? true : window.showUOnElement) && Array.isArray(elementCmAll.klu_list)) { + if ((typeof window.showUOnElement === 'undefined' ? false : window.showUOnElement) && Array.isArray(elementCmAll.klu_list)) { elementCmAll.klu_list.forEach((item) => { if (!item || !item.time) return; const ts = Math.floor(new Date(item.time).getTime() / 1000); @@ -7662,20 +7670,6 @@ refreshChart(currentData); }); - // 绑定KLU分型显示开关 - $('#showKluFxType').change(function() { - refreshChartOnly(); - }); - - // 绑定小周期KLU分型显示开关 - $('#showElementKluFxType').change(function() { - refreshChart(currentData); - }); - - // 绑定买卖点显示开关 - $('#showTradePoints').change(function() { - refreshChart(currentData); - }); // 绑定布林带显示变更事件 $('#showMainBollinger').change(function() {