The BBRSITV strategy is a trading strategy that combines Bollinger Bands (BB), Relative Strength Index (RSI), and True Value (TV) indicators. It aims to identify potential buying and selling opportunities in the market. The strategy starts by calculating the RSI indicator for a given period (default: 14) using the closing prices.
It also calculates a shorter RSI with a period of 4.
The strategy then checks the run mode and proceeds differently based on whether it's in hyperopt mode (used for hyperparameter optimization) or not.
In hyperopt mode, the strategy calculates the Exponential Moving Average (EMA) and Standard Deviation (STDDEV) for different periods (ranging from 5 to 80) based on the RSI. These values are stored as indicators named 'basis_X' and 'dev_X', respectively, where X represents the period length. In non-hyperopt mode, the strategy calculates the EMA and STDDEV for fixed period lengths defined by the strategy configuration. The period lengths are accessed using the 'self.for_ma_length.value' and 'self.for_ma_length_sell.value' variables. Additionally, the strategy calculates the EWO (Elder's Force Index Weighted Oscillator) indicator using the 'fast_ewo' and 'slow_ewo' parameters. The 'populate_buy_trend' function identifies buy signals based on several conditions. It checks if the RSI is below the lower Bollinger Band (basis - dev * sigma), the EWO is above a certain threshold ('ewo_high' value), and the volume is greater than zero. If these conditions are met, a 'buy' signal is generated. The 'populate_sell_trend' function identifies sell signals based on several conditions. It checks if the RSI is above a specified threshold ('rsi_high' value) or if it's above the upper Bollinger Band (basis + dev * sigma_sell). Additionally, the volume must be greater than zero for a sell signal to be generated. The 'BBRSITV4' and 'BBRSITV1' classes inherit from the 'BBRSITV' class and override the 'populate_buy_trend' function to include additional conditions for generating buy signals. In 'BBRSITV4', the buy signal conditions include the RSI being below the lower Bollinger Band, the EWO being above a threshold or between a certain range, the shorter RSI being below a threshold, and the volume being greater than zero. Overall, the BBRSITV strategy combines RSI, Bollinger Bands, and True Value indicators to generate buy and sell signals based on specific conditions.