The EnsembleStrategyV2 is a trading strategy that combines multiple individual strategies to make buy and sell decisions. It uses a combination of different strategies and their signals to generate a collective buy or sell signal. Here are the key components and features of the strategy:
It implements the IStrategy interface from the freqtrade.strategy module.
It defines a list of available strategies in the STRATEGIES variable.
It generates all possible combinations of the available strategies using the STRAT_COMBINATIONS variable.
The strategy has parameters for setting the buy and sell thresholds, as well as the selected combinations of strategies. It has a minimal return on investment (ROI) table that defines the target returns at different stages of the trade. It includes a stop-loss mechanism to limit potential losses. It implements a trailing stop feature to capture profits as the price moves in the desired direction. The strategy initializes by loading and logging the selected buy and sell strategies. It provides informative pairs for the selected timeframe. The strategy has methods to populate indicators, buy trends, and sell trends based on the selected strategies and their signals. It uses the populated indicators to generate buy signals by combining the signals from different strategies and applying a mean threshold. The strategy includes a custom sell method that evaluates the sell signals from the selected strategies and combines them using a mean threshold. The custom sell method also incorporates the trailing stop feature to determine the optimal selling point. Overall, the EnsembleStrategyV2 strategy combines multiple strategies, their signals, and threshold settings to make informed buy and sell decisions while considering stop-loss and trailing stop mechanisms.