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
#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