ADX Momentum Entries with Directional Index and Momentum Filters
Summary
This long-only strategy combines trend strength, directional movement, and momentum on hourly candles. It calculates ADX with a 14-period setting, plus and minus directional indicators with 25-period settings, and 14-period momentum. A long entry requires ADX above 25, positive momentum, plus DI above 25, and plus DI greater than minus DI. The exit rule requires ADX above 25, negative momentum, minus DI above 25, and plus DI below minus DI. Although the indicators also include Parabolic SAR, SAR does not appear in the entry or exit conditions.
The configuration specifies a 1% minimal return target and a 25% stop loss, subject to any overriding configuration. It is adapted from another strategy, but provides no market, backtest period, trade statistics, or performance evidence. The conditions are rule definitions rather than proof of an edge; practical behavior depends on the asset, execution assumptions, and the trading platform’s handling of exits and position management.
Key ideas
- The strategy enters long when ADX and plus DI exceed 25, momentum is positive, and plus DI exceeds minus DI.
- It exits long when ADX and minus DI exceed 25, momentum is negative, and minus DI exceeds plus DI.
- The indicator set includes Parabolic SAR, but the shown rules do not use it.
- The configuration specifies a 1% minimal return target and a 25% stop loss, with possible configuration overrides.
- No instrument, backtest results, or evidence of profitability is provided.
Tags
Full text
# ADXMomentum
# ADXMomentum
author@: Gert Wohlgemuth
converted from:
https://github.com/sthewissen/Mynt/blob/master/src/Mynt.Core/Strategies/AdxMomentum.cs
## Source (GPL-3.0)
```python
# --- Do not remove these libs ---
from freqtrade.strategy import IStrategy
from pandas import DataFrame
import talib.abstract as ta
# --------------------------------
class ADXMomentum(IStrategy):
"""
author@: Gert Wohlgemuth
converted from:
https://github.com/sthewissen/Mynt/blob/master/src/Mynt.Core/Strategies/AdxMomentum.cs
"""
INTERFACE_VERSION: int = 3
# Minimal ROI designed for the strategy.
# adjust based on market conditions. We would recommend to keep it low for quick turn arounds
# This attribute will be overridden if the config file contains "minimal_roi"
minimal_roi = {
"0": 0.01
}
# Optimal stoploss designed for the strategy
stoploss = -0.25
# Optimal timeframe for the strategy
timeframe = '1h'
# Number of candles the strategy requires before producing valid signals
startup_candle_count: int = 20
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe['adx'] = ta.ADX(dataframe, timeperiod=14)
dataframe['plus_di'] = ta.PLUS_DI(dataframe, timeperiod=25)
dataframe['minus_di'] = ta.MINUS_DI(dataframe, timeperiod=25)
dataframe['sar'] = ta.SAR(dataframe)
dataframe['mom'] = ta.MOM(dataframe, timeperiod=14)
return dataframe
def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(
(dataframe['adx'] > 25) &
(dataframe['mom'] > 0) &
(dataframe['plus_di'] > 25) &
(dataframe['plus_di'] > dataframe['minus_di'])
),
'enter_long'] = 1
return dataframe
def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(
(dataframe['adx'] > 25) &
(dataframe['mom'] < 0) &
(dataframe['minus_di'] > 25) &
(dataframe['plus_di'] < dataframe['minus_di'])
),
'exit_long'] = 1
return dataframe
```Shown in full with attribution under the source's licence. Licence: GPL-3.0
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.