The WaveTrend strategy is a trading strategy that utilizes various technical indicators to generate buy and sell signals. Here is a brief description of what the strategy does:
In the populate_indicators method, several technical indicators are added to the input DataFrame. These indicators include:
ap: Average price calculated as the average of high, low, and close prices.
esa: Exponential moving average of ap with a length of n1 (10 in this case).
d: Exponential moving average of the absolute difference between ap and esa with a length of n1.
ci: Commodity Channel Index calculated as the ratio of the difference between ap and esa to (0.015 * d). tci: Exponential moving average of ci with a length of n2 (21 in this case). wt1: WaveTrend indicator set to the value of tci. wt2: Simple moving average of wt1 with a window length of 4. wtVwap: The difference between wt1 and wt2. wtOversold: A boolean indicator indicating whether wt2 is less than or equal to the oversold level (-60 in this case). wtOverbought: A boolean indicator indicating whether wt2 is greater than or equal to the overbought level (30 in this case). The populate_buy_trend method populates the buy signal column in the DataFrame based on the following conditions:
wtCrossUp and wtOversold indicators are both True. The populate_sell_trend method populates the sell signal column in the DataFrame based on the following conditions:
wtCrossDown and wtOverbought indicators are both True. The strategy uses the WaveTrend indicator, crossing conditions, and overbought/oversold levels to generate buy and sell signals. By backtesting this strategy on historical data, you can evaluate its performance and determine its effectiveness in generating profitable trades.