The CombinedStrategy class is an implementation of the IStrategy interface. It consists of three main methods: populate_indicators, populate_entry_trend, and populate_exit_trend. The populate_indicators method adds various technical analysis (TA) indicators to the given DataFrame.
These indicators include the Ultimate Oscillator (uo), Awesome Oscillator (ao), Keltner Channel (kc) upper, middle, and lower bands, percentage and width of Keltner Channel, Average Directional Index (adx), Plus Directional Movement (plus_dm), Plus Directional Indicator (plus_di), Minus Directional Movement (minus_dm), Minus Directional Indicator (minus_di), Commodity Channel Index (cci), volume moving average (vol_ma), Relative Strength Index (rsi), Moving Average Convergence Divergence (macd), Bollinger Bands (bb) upper, middle, and lower bands, percentage and width of Bollinger Bands, Exponential Moving Averages (ema9 and ema21), Simple Moving Averages (sma9 and sma21), Parabolic SAR (sar), Triple Exponential Moving Average (tema), and various candlestick pattern indicators (CDL3LINESTRIKE_15M, CDLSPINNINGTOP, CDLENGULFING_15M, CDLHARAMI, CDL3OUTSIDE_15M, CDL3INSIDE_15M).
It also includes Heikin-Ashi (ha) open and close values.
The populate_entry_trend method uses the TA indicators to determine the entry signal for the given DataFrame. It identifies long entry points when the 9-period Exponential Moving Average (ema9) crosses above the 21-period Exponential Moving Average (ema21) and the Heikin-Ashi bar is green. It identifies short entry points when ema9 crosses below ema21 and the Heikin-Ashi bar is red. The populate_exit_trend method uses the TA indicators to determine the exit signal for the given DataFrame. It identifies long exit points when ema9 crosses below ema21 and the Heikin-Ashi bar is red. It identifies short exit points when ema9 crosses above ema21 and the Heikin-Ashi bar is green. These methods provide the necessary functionality to populate indicators, entry signals, and exit signals for a trading strategy in the backtesting website.