Directional Movement Index (DMI) Trading Strategy
Overview
This strategy implements trend trading based on the Directional Movement Index (DMI). DMI consists of three lines: ADX, +DI and -DI. ADX shows trend strength, values above a threshold indicate a trend; +DI and -DI show upward and downward trend strength. Go long when +DI crosses above -DI, and short when -DI crosses above +DI.
Strategy Logic
Calculate the ADX, +DI and -DI lines. Set a reasonable threshold for ADX to determine if a trend is present, such as 25. When ADX is above this level, if +DI is greater than -DI, an upward trend is identified, go long. If -DI is greater than +DI, a downward trend is identified, go short. Hold the position until a reverse signal appears.
Advantage Analysis
- DMI accurately identifies trend direction with fewer signals
- ADX filters insignificant breakouts to avoid meaningless trades
- Trading in trend direction avoids whipsaws
- Large parameter tuning space - ADX threshold, DI period etc.
Risk Analysis
- Trend reversal can lead to losses
- ADX has lag in determining trend strength
- Long holding periods increase drawdown risk
Mitigate by shortening holding period or adding other indicators to determine trend reversal.
Optimization Directions
- Optimize ADX parameters to balance responsiveness and noise filtering
- Test impact of different holding period settings
- Consider adding moving averages etc. to identify trend reversal
- Test robustness across different products
Conclusion
DMI strategy accurately determines trend direction with controlled drawdown. Further improvements possible through parameter optimization. A simple and practical trend following strategy.
/*backtest
start: 2023-09-10 00:00:00
end: 2023-09-17 00:00:00
period: 30m
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// ©wojak_bogdanoff
// @version=5
// Directional Movement Index (DMI)- 1
