The BollingerBounce strategy is a trading strategy that uses various technical indicators to generate buy and sell signals. In the populate_indicators method, several indicators are added to the given DataFrame, including:
MFI (Money Flow Index)
SMA (Simple Moving Average)
MACD (Moving Average Convergence Divergence)
Stochastic Fast
RSI (Relative Strength Index)
Fisher RSI
Bollinger Bands (upper, middle, and lower bands)
EMA (Exponential Moving Average)
SAR (Stop and Reverse)
These indicators provide insights into market trends, volatility, and price momentum. In the populate_buy_trend method, buy conditions are defined based on the indicator values.
Some of the conditions include:
MFI value is below a certain threshold (buy_mfi_enabled and buy_mfi)
Fisher RSI value is less than a certain threshold (buy_fisher_enabled and buy_fisher)
Bollinger Bands gain is greater than or equal to a certain value (buy_bb_gain)
Close price is higher than the open price
Open price is below the lower Bollinger Band, and the close price is at or above the lower Bollinger Band
Volume is greater than 0
If these conditions are met, the 'buy' column in the DataFrame is set to 1.
The populate_sell_trend method populates the sell signal based on certain conditions.
If the sell_hold value is true, the 'sell' column is set to 0 for all rows. Otherwise, the sell conditions include:
Open price or close price is above the upper Bollinger Band
Fisher RSI value is above a certain threshold (sell_fisher)
SAR value is above the close price
If any of these conditions are met, the 'sell' column is set to 1 in the DataFrame. Overall, the strategy aims to identify potential buying opportunities when certain conditions are met and generate sell signals when specific criteria indicate a potential reversal or exit point.