The ADXMomentum strategy is designed to identify trends and momentum in the market using the Average Directional Index (ADX) indicator. Here's a breakdown of how the strategy works:
The strategy uses the following indicators: ADX, PLUS_DI, MINUS_DI, SAR, and MOM. The minimal_roi attribute sets the minimal return on investment (ROI) expected from the strategy, which is 0.01 (or 1%).
The stoploss attribute determines the optimal stop loss for the strategy, set at -0.25 (or -25%).
The timeframe attribute specifies the optimal timeframe for the strategy, set at 1 hour.
The startup_candle_count attribute determines the number of candles required before the strategy produces valid signals, set at 20. In the populate_indicators() method:
The ADX, PLUS_DI, MINUS_DI, SAR, and MOM indicators are calculated and added to the dataframe. In the populate_buy_trend() method:
A buy signal is generated when the following conditions are met:
ADX is greater than 25. Momentum (MOM) is positive. PLUS_DI is greater than 25. PLUS_DI is greater than MINUS_DI. In the populate_sell_trend() method:
A sell signal is generated when the following conditions are met:
ADX is greater than 25. Momentum (MOM) is negative. MINUS_DI is greater than 25. PLUS_DI is less than MINUS_DI. Overall, the strategy aims to identify potential buying opportunities when there is a strong positive trend with increasing momentum and selling opportunities when there is a strong negative trend with decreasing momentum.