Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【check_bi函数】查找极值时根据min_bi_len过滤 #97

Open
urna opened this issue Jul 31, 2022 · 0 comments
Open

【check_bi函数】查找极值时根据min_bi_len过滤 #97

urna opened this issue Jul 31, 2022 · 0 comments

Comments

@urna
Copy link

urna commented Jul 31, 2022

check_bi函数查找极值时
`min_bi_len = envs.get_min_bi_len()
fxs = check_fxs(bars)
if len(fxs) < 2:
return None, bars

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`

是不是缺了用min_bi_len过滤?
否则如图片
Screenshot from 2022-07-31 16-03-52
这样的,第二根K线和导数第二根K线,就无法连城笔,因为第3根最长,查找的时候总是把它找出来,可它又不满足 >= min_bi_len 条件

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant