The strategy implemented in the code provided is called "two_ema_rsi_bb". Here's a description of what the strategy does:
The strategy uses various indicators such as the Relative Strength Index (RSI), Exponential Moving Averages (EMA), and Bollinger Bands to make buy and sell decisions. Here are the important components of the strategy:
Indicators:
RSI: Calculates the RSI indicator with a time period of 14.
EMA180 and EMA365: Calculates the 180-day and 365-day Exponential Moving Averages.
Bollinger Bands: Calculates the lower Bollinger Band using a window of 20 and standard deviation of 3.
Buy Condition:
The strategy generates a buy signal when the following conditions are met:
RSI is less than or equal to 33. Volume is greater than 0. EMA180 is greater than EMA365. Close price is higher than the lower Bollinger Band. Open price is higher than EMA365. Sell Condition:
The strategy generates a sell signal when either of the following conditions is met:
RSI is greater than or equal to 63. EMA365 crosses above EMA180. Exit Strategies:
Minimal ROI: Defines a table of predefined returns on investment (ROI) at different time intervals. Stoploss: Sets a stop-loss level at -0.14706, which means if the trade reaches a loss of 14.706%, it will be closed. Trailing Stop: Activates a trailing stop, which adjusts the stop-loss level as the trade moves in a profitable direction. The trailing stop parameters are set to a positive value of 0.01544 and an offset of 0.03901. Timeframe:
The strategy is optimized for a 15-minute timeframe. This strategy aims to identify potential buying opportunities based on oversold conditions (low RSI), bullish moving average crossover (EMA180 > EMA365), and price breaking above the lower Bollinger Band. It also generates sell signals based on overbought conditions (high RSI) or bearish moving average crossover (EMA365 crosses above EMA180). The strategy includes predefined ROI targets, a stop-loss level, and a trailing stop to manage risk and capture profits.