Modified Directional Movement Index Strategy
Strategy Logic
This strategy trades based on the Modified Directional Movement Index (DMI). The modified DMI compares the difference between positive directional indicator (+DI) and negative directional indicator (-DI) to judge trend direction.
The trading logic is:
-
Calculate +DI and -DI over a period
-
Map +DI and -DI values to a range from 100 to -100
-
Plot the difference between +DI and -DI as the modified DMI line
-
Go long when modified DMI crosses above 0
-
Go short when modified DMI crosses below 0
-
Optional smoothing of DMI line to filter false signals
The strategy directly compares the relative strength of +DI and -DI to determine trend, overcoming limitations of single indicators.
Advantages
-
Modified DMI intuitively reflects +DI/-DI comparison
-
Smoothing DMI filters fakeouts
-
Clear long/short signal points
Risks
-
DMI itself has lag, may miss timing
-
Parameter period requires optimization
-
Prone to whipsaws in choppy markets
Summary
This strategy judges trend direction change through the modified DMI, providing an alternative view to trend trading. But DMI's lagging nature needs caution, and can be combined with other confirming indicators.
/*backtest
start: 2022-09-07 00:00:00
end: 2023-09-13 00:00:00
period: 3d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy(shorttitle="DMI Modified Strategy", title="DMI Modified Strategy", overlay=true,default_qty_type=strategy.cash, default_qty_value=10000, initial_capital=10000)
// This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License https://creativecommons.org/licenses/by-sa/4.0/
// © dman103- 1
