-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Description
The following logic is problematic because close_roll_max cannot/will not ever be less than the prior close (which is retrieved with df['Close'].shift(1)). I am operating under the assumption though that the underlying df is in chronological order (which is not always the case depending on the API you use for historical data).
# Create a boolean mask for multiple top pattern mask_top = (df['high_roll_max'] >= df['High'].shift(1)) & (**df['close_roll_max'] < df['Close'].shift(1)**) # Create a boolean mask for multiple bottom pattern mask_bottom = (df['low_roll_min'] <= df['Low'].shift(1)) & (**df['close_roll_min'] > df['Close'].shift(1)**)
Metadata
Metadata
Assignees
Labels
No labels