The DivergencesTest strategy is a trading strategy that uses various technical analysis (TA) indicators to generate buy and sell signals. Here's a breakdown of what the strategy does:
populate_indicators function:
Calculates and adds several TA indicators to the input DataFrame. The indicators include moving averages (mean24volume, mean68close), bullish and bearish divergence signals, CCI (Commodity Channel Index), ADX (Average Directional Index), RSI (Relative Strength Index), Stochastic Fast, MACD (Moving Average Convergence Divergence), MFI (Money Flow Index), Bollinger Bands, EMA (Exponential Moving Average), SAR (Stop and Reverse), TEMA (Triple Exponential Moving Average), HT_SINE (Hilbert Transform - SineWave), and HT_LEADSINE (Hilbert Transform - Leading SineWave).
populate_buy_trend function:
Uses the TA indicators to determine the buy signal.
Conditions for the buy signal include RSI <= 40 and bullish divergence.
populate_sell_trend function:
Uses the TA indicators to determine the sell signal. The sell signal is based on bearish divergence. The strategy calculates these indicators and generates buy and sell signals, which can be used for backtesting and evaluating the performance of different trading strategies.