Spinn29

Ehlers Decycler

Spinn29 Aggiornato   
John F. Ehlers introuced Decycler in his book "Cycle Analytics for Traders", chapter 4.

The decycler is designed to remove the influence of shorter cycle fluctuations, resulting in an output that closely resembles a one-pole low-pass filter.

A standout feature of the decycler is its notably minimal lag. The most extended cycle elements experience a delay of less than five bars. When considering a frequency of 0.05 cycles per bar (equivalent to a 20-bar cycle period), the lag approximates 1.5 bars. Components with a higher frequency face even lesser delays. Consequently, any higher-frequency variations that pass the filter's attenuation align closely with the price fluctuations. This makes the decycler an optimal "immediate trend detector," giving a true depiction of the data's trend.

While the SuperSmoother filter can yield a comparably smoothed output, the decycler typically exhibits less lag when the two are juxtaposed. It's worth noting that the decycler operates as a one-pole filter, implying it doesn't have the best filtering capabilities. It's not advisable to use the decycler as a smoothing filter to eliminate aliasing disturbances. Instead, its application should focus on generating an immediate trend representation, especially when choosing a larger cutoff period. The broad cutoff period equips the decycler with the ability to reduce aliasing disturbances, given that it's significantly distant from the Nyquist frequency.

There are already several decycler indicators on Tradingview, but I like to structure the code and highlight the main components as functions rather than hiding them in the code. I hope this is useful for those who are starting to learn Pine Script.
Note di rilascio:
Added the ability to set line thickness and receive alerts.
Also minor changes to the code.
Script open-source

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.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.

Vuoi usare questo script sui tuoi grafici?