You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)**)
The text was updated successfully, but these errors were encountered:
https://github.com/keithorange/PatternPy/blob/2b1f29b17986acafffeb32c83e772417d540c100/tradingpatterns/tradingpatterns.py#L31C5-L34C5
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)**)
The text was updated successfully, but these errors were encountered: