The Directional Movement Index (DMI) is a trend indicator that consists of two lines: +DI and -DI. Optionally, the Average Directional Index (ADX) can be included to measure trend strength.
- +DI: Smoothed positive directional movement
- -DI: Smoothed negative directional movement
- ADX (optional): Average Directional Index, measures trend strength
period(default: 14): Period for smoothingwithADX(default: false): Whether to calculate ADX as well
import { DMI } from '../src/dmi';
const dmi = new DMI();
const result = dmi.nextValue(high, low, close);
// result: { plusDI, minusDI } or { plusDI, minusDI, adx }An object with the following properties:
plusDI: Positive Directional Indicator (+DI)minusDI: Negative Directional Indicator (-DI)adx: Average Directional Index (if withADX is true)