Type/to search

Modified Directional Movement Index Strategy

Cryptocurrency
Created: 2023-09-14 16:41:00
Last modified: 3 years ago
1
Follow
1781
Followers

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:

  1. Calculate +DI and -DI over a period

  2. Map +DI and -DI values to a range from 100 to -100

  3. Plot the difference between +DI and -DI as the modified DMI line

  4. Go long when modified DMI crosses above 0

  5. Go short when modified DMI crosses below 0

  6. 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.

Source
Pine
/*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
Strategy parameters
Strategy parameters
Length
Smoothing length
Moving Average Type
Allow Short
Color bars
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)