/** * Directional Movement Index (DMI) Indicator * * Shows trend direction and strength using +DI, -DI, and ADX lines. * * Based on TradingView's DMI indicator. */ import { type Bar, type IndicatorResult, type InputConfig, type PlotConfig } from 'oakscriptjs'; export interface DMIInputs { /** ADX Smoothing length */ adxSmoothing: number; /** DI Length */ diLength: number; } export declare const defaultInputs: DMIInputs; export declare const inputConfig: InputConfig[]; export declare const plotConfig: PlotConfig[]; export declare const metadata: { title: string; shortTitle: string; overlay: boolean; }; /** * Calculate DMI * * Algorithm from PineScript: * up = ta.change(high) * down = -ta.change(low) * plusDM = na(up) ? na : (up > down and up > 0 ? up : 0) * minusDM = na(down) ? na : (down > up and down > 0 ? down : 0) * trur = ta.rma(ta.tr, len) * plus = fixnan(100 * ta.rma(plusDM, len) / trur) * minus = fixnan(100 * ta.rma(minusDM, len) / trur) * sum = plus + minus * adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), lensig) */ export declare function calculate(bars: Bar[], inputs?: Partial): IndicatorResult; export declare const DMI: { calculate: typeof calculate; metadata: { title: string; shortTitle: string; overlay: boolean; }; defaultInputs: DMIInputs; inputConfig: InputConfig[]; plotConfig: PlotConfig[]; }; //# sourceMappingURL=dmi.d.ts.map