The strategy, named CombinedBinHClucAndMADV6, is implemented as a class that inherits from the IStrategy class. It consists of two main methods: populate_indicators and populate_buy_trend, as well as a third method named populate_sell_trend. In the populate_indicators method, the strategy calculates various indicators based on the provided dataframe and metadata.
It merges the informative 1-hour indicators with the current timeframe indicators using the merge_informative_pair function.
The resulting dataframe is then returned.
The populate_buy_trend method defines the conditions for entering a buy trade. It uses a combination of multiple strategies, each represented by a set of conditions enclosed within parentheses and separated by the logical OR operator (|). The first strategy, named "ClucMay72018," checks for conditions such as the price being above certain moving averages (ema_200, ema_200_1h), below a slower EMA (ema_slow), below a certain percentage of the lower Bollinger Band (bb_lowerband), and the volume meeting specific criteria. The second strategy, also named "ClucMay72018," has similar conditions but with different guard values and additional criteria such as the RSI (Relative Strength Index) being below 15. The next strategy, named "MACD Low buy," checks for conditions such as the price being above certain moving averages (ema_200, ema_200_1h), the MACD histogram (difference between the 26-day and 12-day exponential moving averages) being positive and above a certain threshold, and the volume meeting specific criteria. The second part of this strategy has similar conditions but with different threshold values. The final strategy checks for conditions such as the price being below a certain moving average (sma_5), the SSL indicator (Super Trend) on the 1-hour timeframe indicating an uptrend, certain EMAs (ema_slow, ema_200, ema_200_1h, ema_50_1h) being in specific relationships, the RSI being below a calculated threshold, and the volume being greater than zero. When any of the buy conditions are met, the corresponding row in the "buy" column of the dataframe is set to 1. The populate_sell_trend method defines the conditions for exiting a buy trade. It checks for conditions such as the price being above a certain percentage of the middle Bollinger Band (bb_middleband), and the volume being greater than zero. When these conditions are met, the corresponding row in the "sell" column of the dataframe is set to 1. Overall, the CombinedBinHClucAndMADV6 strategy combines multiple buy conditions from different strategies to determine entry points, and it has a single sell condition for exit points.