The Rsiqui strategy is a trading strategy that uses the Relative Strength Index (RSI) indicator to generate buy and sell signals. Here's a breakdown of how it works:
The strategy is designed to be used on 5-minute timeframe data. The RSI indicator with a time period of 14 is calculated for the given data.
The slope of the RSI indicator is calculated using the numpy.gradient function over a 60-period window.
In the populate_buy_trend method:
A buy signal is generated when the RSI value is below 30 and the slope of the RSI becomes positive.
The buy signal is indicated by setting the 'buy' column of the dataframe to 1. In the populate_sell_trend method:
A sell signal is generated when the RSI value is above 60 and the slope of the RSI becomes negative. The sell signal is indicated by setting the 'sell' column of the dataframe to 1. The strategy uses a random minimal_roi (return on investment) value of 0.10, which indicates the desired profit target. The strategy also uses a random stoploss value of -0.25, which indicates the maximum tolerable loss. Overall, the Rsiqui strategy aims to identify potential buying opportunities when the RSI is oversold (below 30) and shows signs of upward momentum, and selling opportunities when the RSI is overbought (above 60) and shows signs of downward momentum.