HOSE:VNM   VIET NAM DAIRY PRODUCTS JOINT STOCK COMPANY
import pandas as pd
import ta.volatility as vol

# Load stock price data into a pandas DataFrame
df = pd.read_csv('stock_prices.csv')

# Calculate Bollinger Bands
df, df, df = vol.bollinger_hband(df), vol.bollinger_mavg(df), vol.bollinger_lband(df)

# Filter stock price movements that are above the upper Bollinger Band
df = df > df

# Filter stock price movements that are below the lower Bollinger Band
df = df < df

# Print the filtered stock price movements
print(df[df | df])
Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.