The BBRSIOptimStrategy is a backtesting strategy that uses Bollinger Bands and RSI (Relative Strength Index) indicators to generate buy and sell signals for trading. Here is a brief explanation of what the strategy does:
The strategy calculates the RSI indicator using the ta.RSI function and adds it to the dataframe. It also calculates two Bollinger Bands with different standard deviations (1 and 2) using the qtpylib.bollinger_bands function and adds the lower band values to the dataframe.
For the buy signal, the strategy identifies a condition where the RSI is above 12 and the closing price is below the lower band with 2 standard deviations.
It marks these instances with a value of 1 in the 'buy' column of the dataframe.
For the sell signal, the strategy identifies a condition where the RSI is above 96 and the closing price is above the lower band with 1 standard deviation. It marks these instances with a value of 1 in the 'sell' column of the dataframe. The strategy has predefined values for minimal ROI (Return on Investment) and stop loss. It operates on 5-minute candlestick data and requires a minimum of 30 candles before producing valid signals. The strategy supports limit orders for buying and selling, and the order time in force is set to 'gtc' (good 'til canceled). Additionally, it provides a plot configuration for visualizing indicators such as TEMA, SAR, MACD, and RSI. Please note that this is just a summary of the strategy, and there may be more details and considerations involved when implementing it in a backtesting website.