The ADXDM strategy is a trading strategy that uses several technical indicators to generate buy and sell signals. Here's a breakdown of what the strategy does:
In the populate_indicators method, the strategy adds the following indicators to the given DataFrame:
ADX (Average Directional Index)
PLUS_DM and MINUS_DM (Directional Movement indicators)
Difference between dm_plus and dm_minus
Delta of ADX (normalized for display)
ADX slope (linear regression slope of ADX)
Bollinger Bands (upper and lower bands)
BB gain (percentage difference between upper band and close price)
SMA (Simple Moving Average) with a time period of 20
TEMA (Triple Exponential Moving Average) with a time period of 20
MFI (Money Flow Index)
RSI (Relative Strength Index)
Fisher RSI (a transformation of RSI)
In the populate_buy_trend method, the strategy determines the buy signal based on the following conditions:
ADX is not null
If enabled, MFI (Money Flow Index) is less than or equal to ADX
ADX is greater than a specified value (buy_adx)
ADX slope crosses below zero
Difference between dm_plus and dm_minus is negative
In the populate_sell_trend method, the strategy determines the sell signal based on the following conditions:
ADX is greater than a specified value (buy_adx)
ADX slope crosses below zero
Difference between dm_plus and dm_minus is positive
If enabled, BB gain is greater than or equal to a specified value (buy_bb_gain)
If sell_hold is enabled, no sell signal is generated
The strategy calculates buy and sell signals based on the combination of these conditions and updates the 'buy' and 'sell' columns in the DataFrame accordingly.