The BollingerBounce strategy is a trading strategy that utilizes various technical analysis indicators to determine entry and exit points for trades. Here is a brief description of what the strategy does:
In the populate_indicators method, several indicators are calculated and added to the DataFrame:
MFI (Money Flow Index)
SMA (Simple Moving Average) with a time period of 40
MACD (Moving Average Convergence Divergence)
Stochastic Fast %K and %D
RSI (Relative Strength Index)
Fisher RSI
Bollinger Bands (upper, middle, and lower bands) using a weighted calculation
EMA (Exponential Moving Average) with time periods of 5, 10, 50, and 100
SAR (Stop and Reverse)
The populate_entry_trend method determines the conditions for entering a trade based on the calculated indicators:
If enabled, the MFI should be less than or equal to a specified value (buy_mfi)
If enabled, the Fisher RSI should be less than a specified value (buy_fisher)
The Bollinger Band gain should be greater than or equal to a specified value (buy_bb_gain)
The close price should be higher than the open price
The open price should be below the lower Bollinger Band, and the close price should be at or above the lower Bollinger Band
The volume should be greater than 0
The populate_exit_trend method determines the conditions for exiting a trade based on the calculated indicators:
If enabled, the strategy can hold positions without selling (sell_hold)
Otherwise, the sell signal is determined by the following conditions:
If the open price or the close price is above the upper Bollinger Band
If the Fisher RSI is higher than a specified value (sell_fisher) and the SAR (Stop and Reverse) is above the close price
The strategy uses these indicators and conditions to generate buy and sell signals, which can be used for backtesting and evaluating the performance of the trading strategy.