The bbrsi7sortino strategy is a backtesting strategy that utilizes technical analysis (TA) indicators to generate buy and sell signals for trading. Here is a short description of what the strategy does:
populate_indicators function:
This function adds various TA indicators to the given DataFrame, which contains data from the exchange. The indicators used are:
Relative Strength Index (RSI)
Bollinger Bands with a window of 20 and standard deviations of 1 (bb_lowerband1, bb_middleband1, bb_upperband1)
Bollinger Bands with a window of 30 and standard deviations of 4 (bb_lowerband4, bb_middleband4, bb_upperband4)
The function returns a DataFrame with all the mandatory indicators for the strategy.
populate_buy_trend function:
This function populates the buy signal for the DataFrame based on the TA indicators.
The buy signal is triggered when the close price is below the lower Bollinger Band with 4 standard deviations (bb_lowerband4).
The function assigns a value of 1 to the 'buy' column for the corresponding rows where the buy signal is present. The function returns the DataFrame with the 'buy' column populated. populate_sell_trend function:
This function populates the sell signal for the DataFrame based on the TA indicators. The sell signal is triggered when the RSI is above 89 and the close price is above the upper Bollinger Band with 1 standard deviation (bb_upperband1). The function assigns a value of 1 to the 'sell' column for the corresponding rows where the sell signal is present. The function returns the DataFrame with the 'sell' column populated. The strategy also includes a dictionary named minimal_roi, which defines the expected return on investment (ROI) at different time intervals (0, 40, 60, and 120).