Presented here is code for the "Directional Movement w/Hann" indicator originally conceived by John Ehlers. The code is also published in the December 2021 issue of Trader's Tips by Technical Analysis of Stocks & Commodities (TASC) magazine.
continues here his exploration of the application of Hann windowing to conventional trading indicators.
The rolling length can be modified in the script's inputs, as well as the width of the line.
The calculation starts with the classic definition of PlusDM and MinusDM. These directional movements are summed in an ( ). Then, this is further smoothed in a finite impulse response (FIR) filter using Hann window coefficients over the calculation period.
The DMI and ADX indicators were designed by J. Welles Wilder and presented in his "New Concepts in Technical Trading Systems" book published in 1978.
Pine news broadcasts: https://t.me/PineCodersSquawkBox or https://twitter.com/PineCoders
Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzarlo gratuitamente, ma il riutilizzo del codice è subordinato al rispetto del Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.