From 55791afed12b9ead25f1a6cc4baeef5330049e5b Mon Sep 17 00:00:00 2001 From: jackyu66git Date: Tue, 10 Jun 2025 01:11:22 +0800 Subject: [PATCH] change the klc fx strength --- ChanKLC.py | 17 +++++++++-------- ChanLun.py | 4 ++-- web/app.py | 2 +- web/templates/index.html | 16 ++++++++-------- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/ChanKLC.py b/ChanKLC.py index 8b0aed8..c613b9d 100644 --- a/ChanKLC.py +++ b/ChanKLC.py @@ -1214,7 +1214,8 @@ class ChanKLC(): # 分型质量调整 base_score += fx_quality - #print(self.start_time, base_score, is_bi_end, post_fx_confirmation, fx_quality) + print(self.start_time, base_score, is_bi_end, post_fx_confirmation, fx_quality) + # 2025-06-07 08:15:00 1.5 0 0.8 0.7 # 限制在-3到3范围内 return max(-3, min(3, base_score)) @@ -1235,7 +1236,7 @@ class ChanKLC(): # 获取分型后的几根K线数据 subsequent_klcs = [] temp = self.next - for i in range(klc_offset): # 检查后续4根K线 + for i in range(klc_offset): if temp: subsequent_klcs.append(temp) temp = temp.next if hasattr(temp, 'next') else None @@ -1244,7 +1245,7 @@ class ChanKLC(): if len(subsequent_klcs) < 2: return 0 - + print(subsequent_klcs[len(subsequent_klcs)-1].start_time) if self.fx == Chan_FX_TYPE.TOP: return self._check_top_bi_ending(subsequent_klcs) else: # BOTTOM @@ -1283,7 +1284,7 @@ class ChanKLC(): return 2 # 可能笔终结:部分条件满足 - if (broken_key_levels >= 1 and new_highs <= 1) or (new_highs == 0 and downward_trend >= 3): + if (broken_key_levels >= 1 and new_highs <= 1) or (new_highs == 0 and downward_trend >= 1): return 1 # 明显中继:出现新高且未跌破关键位 @@ -1323,13 +1324,13 @@ class ChanKLC(): # 检查上涨趋势 if i > 0 and klc.close > subsequent_klcs[i-1].close: upward_trend += 1 - + # 强烈笔终结:突破关键位且无新低 if broken_key_levels >= 1 and new_lows == 0 and upward_trend >= 2: return 2 # 可能笔终结:部分条件满足 - if (broken_key_levels >= 1 and new_lows <= 1) or (new_lows == 0 and upward_trend >= 3): + if (broken_key_levels >= 1 and new_lows <= 1) or (new_lows == 0 and upward_trend >= 1): return 1 # 明显中继:出现新低且未突破关键位 @@ -1392,7 +1393,7 @@ class ChanKLC(): high_diff1 = (self.high - self.pre.high) / self.high if self.high > 0 else 0 high_diff2 = (self.high - self.next.high) / self.high if self.high > 0 else 0 min_diff = 33*min(high_diff1, high_diff2) - print(min_diff) + if min_diff > 0.03: # 非常突出 score += 0.5 elif min_diff > 0.01: # 比较突出 @@ -1404,7 +1405,7 @@ class ChanKLC(): # 低点突出程度 low_diff1 = (self.pre.low - self.low) / self.pre.low if self.pre.low > 0 else 0 low_diff2 = (self.next.low - self.low) / self.next.low if self.next.low > 0 else 0 - min_diff = min(low_diff1, low_diff2) + min_diff = 33*min(low_diff1, low_diff2) if min_diff > 0.03: # 非常突出 score += 0.5 diff --git a/ChanLun.py b/ChanLun.py index 85f07c6..9c404d4 100644 --- a/ChanLun.py +++ b/ChanLun.py @@ -767,7 +767,7 @@ class ChanLun(): if last_top.index + 4 < klc.index and len(bi_list) > 1: pre_last_bi = bi_list[-2] last_bi = bi_list[-1] - if pre_last_bi.is_sure and not last_bi.is_sure and pre_last_bi.dir == Chan_BI_DIR.UP and False: + if pre_last_bi.is_sure and not last_bi.is_sure and pre_last_bi.dir == Chan_BI_DIR.UP: pre_last_bi.update_bi(klc) bi_list.remove(last_bi) pre_last_bi.set_next(None) @@ -887,7 +887,7 @@ class ChanLun(): if last_bottom.index + 4 < klc.index and len(bi_list) > 1: pre_last_bi = bi_list[-2] last_bi = bi_list[-1] - if pre_last_bi.is_sure and not last_bi.is_sure and pre_last_bi.dir == Chan_BI_DIR.DOWN and False: + if pre_last_bi.is_sure and not last_bi.is_sure and pre_last_bi.dir == Chan_BI_DIR.DOWN: pre_last_bi.update_bi(klc) bi_list.remove(last_bi) pre_last_bi.set_next(None) diff --git a/web/app.py b/web/app.py index a9d16a9..4ae27be 100644 --- a/web/app.py +++ b/web/app.py @@ -1280,4 +1280,4 @@ def format_fx_type(fx_type): return fx_type_map.get(fx_type, fx_type) if __name__ == '__main__': - app.run(debug=True, host='0.0.0.0', port=8120) \ No newline at end of file + app.run(debug=True, host='0.0.0.0', port=8128) \ No newline at end of file diff --git a/web/templates/index.html b/web/templates/index.html index acfb04f..aaadd66 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -3250,8 +3250,8 @@ // 构建显示文本,包含分型类型和强度信息 let displayText = `${fx.fx_strength.toFixed(1)}`; - if (fx.fx_strength < 1.1) { // 降低阈值,让更多分型显示 - displayText = fx.fx_strength >= 0.8 ? '•' : '' // 0.8以上显示点,0.8以下不显示文本 + if (fx.fx_strength < 2.2) { // 降低阈值,让更多分型显示 + displayText = fx.fx_strength >= 0.8 ? '' : '' // 0.8以上显示点,0.8以下不显示文本 } // 添加标记配置 @@ -3314,8 +3314,8 @@ // 构建显示文本,包含分型类型和强度信息 let displayText = `${fx.fx_strength.toFixed(1)}`; - if (fx.fx_strength < 1.8) { // 降低阈值,让更多分型显示 - displayText = fx.fx_strength >= 1.5 ? '•' : '' // 0.8以上显示点,0.8以下不显示文本 + if (fx.fx_strength < 2.0) { // 降低阈值,让更多分型显示 + displayText = fx.fx_strength >= 1.5 ? '' : '' // 0.8以上显示点,0.8以下不显示文本 } // 添加标记配置 @@ -3399,8 +3399,8 @@ let strengthColor = fx.is_bottom ? '#11116B' : '#222222'; // 底分型用珊瑚红,顶分型用薄荷绿 let displayText = `${fx.fx_strength.toFixed(1)}`; // 构建小周期分型显示文本 - if (fx.fx_strength < 1.5){ // 调整小周期阈值 - displayText = fx.fx_strength >= 0.6 ? '•' : '' // 0.6以上显示点 + if (fx.fx_strength < 2.0){ // 调整小周期阈值 + displayText = fx.fx_strength >= 0.6 ? '' : '' // 0.6以上显示点 } // 小周期分型标记配置 @@ -3455,8 +3455,8 @@ let strengthColor = fx.is_bottom ? '#9A8C98' : '#F2CC8F'; // 底分型用灰紫色,顶分型用浅黄色 let displayText = `${fx.fx_strength.toFixed(1)}`; // 构建小周期分型显示文本 - if (fx.fx_strength < 1.8){ // 调整小周期阈值 - displayText = fx.fx_strength >= 1.5 ? '•' : '' // 0.6以上显示点 + if (fx.fx_strength < 2.0){ // 调整小周期阈值 + displayText = fx.fx_strength >= 1.5 ? '' : '' // 0.6以上显示点 } // 小周期KLU分型标记配置