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

Possible bug in regime_floor_ceiling() (Chapter 5) #4

Open
bjahnke opened this issue Mar 24, 2022 · 0 comments
Open

Possible bug in regime_floor_ceiling() (Chapter 5) #4

bjahnke opened this issue Mar 24, 2022 · 0 comments

Comments

@bjahnke
Copy link

bjahnke commented Mar 24, 2022

If the breakdown test passes, only floor_found and breakout are set to False (floor_found is written twice). Whereas breakout sets floor_found, ceiling_found, and breakdown to False.

            ### 2. if price.cummax penetrates swing high: regime turns bullish, breakout
            if (df.loc[rg_ch_ix_list[-1] : swing_max_ix, rg] >0).any():
                ### Boolean flags reset
                floor_found = ceiling_found = breakdown = False
                breakout = True

            ### 2. if price.cummin penetrates swing low: regime turns bearish, breakdown
            if (df.loc[rg_ch_ix_list[-1] : swing_max_ix, rg] <0).any():
                floor_found = floor_found = breakout = False
                breakdown = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant