change the klc fx strength

This commit is contained in:
jackyu66git
2025-06-10 01:11:22 +08:00
parent fca57e23e8
commit 55791afed1
4 changed files with 20 additions and 19 deletions
+9 -8
View File
@@ -1214,7 +1214,8 @@ class ChanKLC():
# 分型质量调整 # 分型质量调整
base_score += fx_quality 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范围内 # 限制在-3到3范围内
return max(-3, min(3, base_score)) return max(-3, min(3, base_score))
@@ -1235,7 +1236,7 @@ class ChanKLC():
# 获取分型后的几根K线数据 # 获取分型后的几根K线数据
subsequent_klcs = [] subsequent_klcs = []
temp = self.next temp = self.next
for i in range(klc_offset): # 检查后续4根K线 for i in range(klc_offset):
if temp: if temp:
subsequent_klcs.append(temp) subsequent_klcs.append(temp)
temp = temp.next if hasattr(temp, 'next') else None temp = temp.next if hasattr(temp, 'next') else None
@@ -1244,7 +1245,7 @@ class ChanKLC():
if len(subsequent_klcs) < 2: if len(subsequent_klcs) < 2:
return 0 return 0
print(subsequent_klcs[len(subsequent_klcs)-1].start_time)
if self.fx == Chan_FX_TYPE.TOP: if self.fx == Chan_FX_TYPE.TOP:
return self._check_top_bi_ending(subsequent_klcs) return self._check_top_bi_ending(subsequent_klcs)
else: # BOTTOM else: # BOTTOM
@@ -1283,7 +1284,7 @@ class ChanKLC():
return 2 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 return 1
# 明显中继:出现新高且未跌破关键位 # 明显中继:出现新高且未跌破关键位
@@ -1323,13 +1324,13 @@ class ChanKLC():
# 检查上涨趋势 # 检查上涨趋势
if i > 0 and klc.close > subsequent_klcs[i-1].close: if i > 0 and klc.close > subsequent_klcs[i-1].close:
upward_trend += 1 upward_trend += 1
# 强烈笔终结:突破关键位且无新低 # 强烈笔终结:突破关键位且无新低
if broken_key_levels >= 1 and new_lows == 0 and upward_trend >= 2: if broken_key_levels >= 1 and new_lows == 0 and upward_trend >= 2:
return 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 return 1
# 明显中继:出现新低且未突破关键位 # 明显中继:出现新低且未突破关键位
@@ -1392,7 +1393,7 @@ class ChanKLC():
high_diff1 = (self.high - self.pre.high) / self.high if self.high > 0 else 0 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 high_diff2 = (self.high - self.next.high) / self.high if self.high > 0 else 0
min_diff = 33*min(high_diff1, high_diff2) min_diff = 33*min(high_diff1, high_diff2)
print(min_diff)
if min_diff > 0.03: # 非常突出 if min_diff > 0.03: # 非常突出
score += 0.5 score += 0.5
elif min_diff > 0.01: # 比较突出 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_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 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: # 非常突出 if min_diff > 0.03: # 非常突出
score += 0.5 score += 0.5
+2 -2
View File
@@ -767,7 +767,7 @@ class ChanLun():
if last_top.index + 4 < klc.index and len(bi_list) > 1: if last_top.index + 4 < klc.index and len(bi_list) > 1:
pre_last_bi = bi_list[-2] pre_last_bi = bi_list[-2]
last_bi = bi_list[-1] 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) pre_last_bi.update_bi(klc)
bi_list.remove(last_bi) bi_list.remove(last_bi)
pre_last_bi.set_next(None) pre_last_bi.set_next(None)
@@ -887,7 +887,7 @@ class ChanLun():
if last_bottom.index + 4 < klc.index and len(bi_list) > 1: if last_bottom.index + 4 < klc.index and len(bi_list) > 1:
pre_last_bi = bi_list[-2] pre_last_bi = bi_list[-2]
last_bi = bi_list[-1] 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) pre_last_bi.update_bi(klc)
bi_list.remove(last_bi) bi_list.remove(last_bi)
pre_last_bi.set_next(None) pre_last_bi.set_next(None)
+1 -1
View File
@@ -1280,4 +1280,4 @@ def format_fx_type(fx_type):
return fx_type_map.get(fx_type, fx_type) return fx_type_map.get(fx_type, fx_type)
if __name__ == '__main__': if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0', port=8120) app.run(debug=True, host='0.0.0.0', port=8128)
+8 -8
View File
@@ -3250,8 +3250,8 @@
// 构建显示文本,包含分型类型和强度信息 // 构建显示文本,包含分型类型和强度信息
let displayText = `${fx.fx_strength.toFixed(1)}`; let displayText = `${fx.fx_strength.toFixed(1)}`;
if (fx.fx_strength < 1.1) { // 降低阈值让更多分型显示 if (fx.fx_strength < 2.2) { // 降低阈值让更多分型显示
displayText = fx.fx_strength >= 0.8 ? '' : '' // 0.8以上显示点,0.8以下不显示文本 displayText = fx.fx_strength >= 0.8 ? '' : '' // 0.8以上显示点,0.8以下不显示文本
} }
// 添加标记配置 // 添加标记配置
@@ -3314,8 +3314,8 @@
// 构建显示文本,包含分型类型和强度信息 // 构建显示文本,包含分型类型和强度信息
let displayText = `${fx.fx_strength.toFixed(1)}`; let displayText = `${fx.fx_strength.toFixed(1)}`;
if (fx.fx_strength < 1.8) { // 降低阈值让更多分型显示 if (fx.fx_strength < 2.0) { // 降低阈值让更多分型显示
displayText = fx.fx_strength >= 1.5 ? '' : '' // 0.8以上显示点,0.8以下不显示文本 displayText = fx.fx_strength >= 1.5 ? '' : '' // 0.8以上显示点,0.8以下不显示文本
} }
// 添加标记配置 // 添加标记配置
@@ -3399,8 +3399,8 @@
let strengthColor = fx.is_bottom ? '#11116B' : '#222222'; // 底分型用珊瑚红,顶分型用薄荷绿 let strengthColor = fx.is_bottom ? '#11116B' : '#222222'; // 底分型用珊瑚红,顶分型用薄荷绿
let displayText = `${fx.fx_strength.toFixed(1)}`; let displayText = `${fx.fx_strength.toFixed(1)}`;
// 构建小周期分型显示文本 // 构建小周期分型显示文本
if (fx.fx_strength < 1.5){ // 调整小周期阈值 if (fx.fx_strength < 2.0){ // 调整小周期阈值
displayText = fx.fx_strength >= 0.6 ? '' : '' // 0.6以上显示点 displayText = fx.fx_strength >= 0.6 ? '' : '' // 0.6以上显示点
} }
// 小周期分型标记配置 // 小周期分型标记配置
@@ -3455,8 +3455,8 @@
let strengthColor = fx.is_bottom ? '#9A8C98' : '#F2CC8F'; // 底分型用灰紫色,顶分型用浅黄色 let strengthColor = fx.is_bottom ? '#9A8C98' : '#F2CC8F'; // 底分型用灰紫色,顶分型用浅黄色
let displayText = `${fx.fx_strength.toFixed(1)}`; let displayText = `${fx.fx_strength.toFixed(1)}`;
// 构建小周期分型显示文本 // 构建小周期分型显示文本
if (fx.fx_strength < 1.8){ // 调整小周期阈值 if (fx.fx_strength < 2.0){ // 调整小周期阈值
displayText = fx.fx_strength >= 1.5 ? '' : '' // 0.6以上显示点 displayText = fx.fx_strength >= 1.5 ? '' : '' // 0.6以上显示点
} }
// 小周期KLU分型标记配置 // 小周期KLU分型标记配置