dmi
forge.ta.dmi(high: ArrayLike,low: ArrayLike,close: ArrayLike,period: int = 14,method: str = 'mt5') -> dict[str, np.ndarray]Directional movement: plus_di, minus_di and adx.
Parameters
| Name | Type | Default |
|---|---|---|
| high | ArrayLike | |
| low | ArrayLike | |
| close | ArrayLike | |
| period | int | 14 |
| method | str | 'mt5' |
Indicator: Directional movement index
method="mt5" is MetaTrader 5's ADX (2 / (period + 1) smoothing seeded at zero; every
line starts at bar period). method="wilder" is Wilder's original (1 / period
smoothing seeded with plain means; the DI lines start at bar period and ADX at
2 * period - 1). Where the true range is zero the lines read 0.
forge.ta.DMI(**inputs: Any) -> NoneTrend direction as two lines, with the strength of the trend.
Inputs
| Name | Type | Default | Range |
|---|---|---|---|
| period | int | 14 | 1 to 500 |
| method | choice | mt5 |
TR = the true range, +DM and -DM = the larger of the two directional moves, the other is 0
+DI = 100 * smoothed(+DM) / smoothed(TR), -DI = 100 * smoothed(-DM) / smoothed(TR)
DX = 100 * |+DI - -DI| / (+DI + -DI), ADX = smoothed(DX)
mt5: smoothing with 2 / (period + 1), starting from zero. wilder: smoothing with 1 / period, starting from the mean of the first period values. Where the true range is zero the lines read 0.