Spinn29

Ehlers Decycler

Spinn29 Mis à jour   
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.
Notes de version:
Added the ability to set line thickness and receive alerts.
Also minor changes to the code.
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?