The BBandsRSI strategy is a trading strategy that combines Bollinger Bands and the Relative Strength Index (RSI) to generate buy and sell signals. Here's a breakdown of what the strategy does:
populate_indicators: This function adds various technical analysis (TA) indicators to the given DataFrame. The indicators used are RSI, overbought level (set at 70), oversold level (set at 30), Bollinger Bands' lower band, middle band, upper band, percentage deviation from the lower band, and width of the Bollinger Bands.
populate_buy_trend: This function populates the buy signal for the DataFrame based on the TA indicators.
The conditions for a buy signal are:
RSI value is below 30 (indicating oversold condition)
Close price is below the Bollinger Bands' lower band
Volume is greater than 0 (to ensure there is trading activity)
populate_sell_trend: This function populates the sell signal for the DataFrame based on the TA indicators.
The condition for a sell signal is:
RSI value is above 70 (indicating overbought condition)
Volume is greater than 0 (to ensure there is trading activity)
The strategy uses these buy and sell signals to determine when to enter or exit a trade.