fx_a = fxs[0]
try:
if fxs[0].mark == Mark.D:
direction = Direction.Up
fxs_b = [x for x in fxs if x.mark == Mark.G and x.dt > fx_a.dt and x.fx > fx_a.fx]
if not fxs_b:
return None, bars
fx_b = fxs_b[0]
for fx in fxs_b:
if fx.high >= fx_b.high:
fx_b = fx
elif fxs[0].mark == Mark.G:
direction = Direction.Down
fxs_b = [x for x in fxs if x.mark == Mark.D and x.dt > fx_a.dt and x.fx < fx_a.fx]
if not fxs_b:
return None, bars
fx_b = fxs_b[0]
for fx in fxs_b[1:]:
if fx.low <= fx_b.low:
fx_b = fx`
check_bi函数查找极值时 `min_bi_len = envs.get_min_bi_len() fxs = check_fxs(bars) if len(fxs) < 2: return None, bars
是不是缺了用min_bi_len过滤? 否则如图片 这样的,第二根K线和导数第二根K线,就无法连城笔,因为第3根最长,查找的时候总是把它找出来,可它又不满足 >= min_bi_len 条件