The "Obelisk_Ichimoku_ZEMA_v1" strategy is a backtesting strategy that utilizes the Ichimoku Cloud indicator and a ZEMA (Zero Lag Exponential Moving Average) indicator. Here's a breakdown of what the strategy does:
In the "populate_indicators" method:
It checks if the timeframe is set to 5 minutes and raises an assertion error if not. If the timeframe matches the informative timeframe, it applies slow timeframe indicators to the given dataframe and metadata.
Otherwise, it ensures that a DataProvider is available for multiple timeframes and retrieves the informative dataframe.
The informative dataframe is also processed with slow timeframe indicators.
The informative and main dataframes are merged based on the timeframe and informative timeframe, with forward filling of missing values. Certain columns are skipped during the merge. Fast timeframe indicators are applied to the main dataframe. The updated dataframe is returned. In the "populate_buy_trend" method:
A buy trend is populated based on certain conditions:
The Ichimoku Cloud is considered valid. The market is not in a bearish trend. The closing price is below a calculated ZEMA value multiplied by a low offset value. The "buy" column in the dataframe is set to 1 for the matching rows. The updated dataframe is returned. In the "populate_sell_trend" method:
A sell trend is populated based on the condition:
The closing price is above a calculated ZEMA value multiplied by a high offset value. The "sell" column in the dataframe is set to 1 for the matching rows. The updated dataframe is returned. In the "synchronize_portfolio" method (not shown in the code snippet):
This method determines whether to sell an asset in the portfolio based on the sell reason, current time, and other parameters. If the sell reason is 'roi' (return on investment) and the latest analyzed dataframe indicates a positive trend, it returns False (indicating not to sell). The strategy also includes a plot configuration dictionary that specifies the colors for various indicators and subplots used in visualizing the backtesting results. Overall, the strategy combines the Ichimoku Cloud indicator, ZEMA indicator, and specific buy/sell conditions to generate trading signals for backtesting purposes.