The ADXDM strategy is a trading strategy that uses various technical indicators to determine entry and exit points for trades. Here is a breakdown of what the strategy does:
In the populate_indicators method:
Several indicators are calculated and added to the dataframe, including ADX (Average Directional Index), PLUS_DM, MINUS_DM, the difference between PLUS_DM and MINUS_DM (dm_delta), the delta of ADX (adx_delta), the slope of ADX (adx_slope), Bollinger Bands (bb_upperband and bb_lowerband), the gain from Bollinger Bands (bb_gain), SMA (Simple Moving Average), TEMA (Triple Exponential Moving Average), MFI (Money Flow Index), RSI (Relative Strength Index), and Fisher RSI. In the populate_entry_trend method:
Conditions are defined for determining the entry points for trades.
The conditions include checking if ADX is not null, MFI is less than or equal to ADX (if enabled), ADX is greater than a specified value (buy_adx), the slope of ADX has crossed below 0, and dm_delta is less than 0.
If the conditions are met, the 'buy' column in the dataframe is set to 1.
In the populate_exit_trend method:
Conditions are defined for determining the exit points for trades. The conditions include checking if ADX is greater than a specified value (buy_adx), the slope of ADX has crossed below 0, and dm_delta is greater than 0. If the buy_bb_enabled option is enabled, an additional condition is added, checking if the bb_gain is greater than or equal to a specified value (buy_bb_gain). If the conditions are met, the 'sell' column in the dataframe is set to 1. If the sell_hold option is enabled, all rows in the 'sell' column with a non-null close value are set to 0. Overall, the ADXDM strategy uses ADX, MFI, RSI, Bollinger Bands, and other indicators to identify potential entry and exit points for trades based on specific conditions.