OPEN-SOURCE SCRIPT

[blackcat] L2 Ehlers Dominant Cycle Tuned Bandpass Filter

Level: 2

Background

John F. Ehlers introuced his Dominant Cycle Tuned Bandpass Filter Strategy in Mar, 2008.

Function

In "Measuring Cycle Periods", author John Ehlers presents a very interesting technique of measuring dominant market cycle periods by means of multiple bandpass filtering. By utilizing an approach similar to audio equalizers, the signal (here, the price series) is fed into a set of simple second-order infinite impulse response bandpass filters. Filters are tuned to 8,9,10,...,50 periods. The filter with the highest output represents the dominant cycle. A full-featured formula that implements a high-pass filter and a six-tap low-pass Fir filter on input, then 42 parallel Iir band-pass filters.

I've coded John Ehlers' filter bank to measure the dominant cycle (DC) and the sine and cosine filter components in pine v4 for TradingView, based on John Ehlers' article in this issue, "Measuring Cycle Periods." The CycleFilterDC function plots and returns the DC series and its components, so it's a trivial matter to make use of them in a trading strategy.


Based on John Ehlers' article, "Measuring Cycle Periods," he chose to implement the dominant cycle-tuned bandpass filter response to test Ehlers' suggestion to use the sine and cosine crossovers as buy and sell signals. If the sine closely follows the price pattern as suggested, and the cosine is an effective leading function of the sine, then it seems to make sense that a crossover implementation would work well (Personally, what I observed this is not so accurated as his claims).

What he discovered in his tests was that crossovers happened at frequent intervals, even when price has not moved significantly. This leads to a higher percentage of losing trades, particularly when spread, slippage, and commissions are accounted for. Nevertheless, the cosine crossover was quite effective at identifying reversals very early in many cases, so this indicator could prove quite effective when used alongside other indicators. In particular, the use of an indicator to confirm a certain level of recent volatility, as well as an indicator to confirm significant rate of change, could prove quite helpful.


Key Signal

CosineLine--> Ehlers Dominant Cycle Tuned Bandpass Filter Strategy fast line
SineLine--> Ehlers Dominant Cycle Tuned Bandpass Filter Strategy slow line

Pros and Cons

100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.

Remarks

The 72th script for Blackcat1402 John F. Ehlers Week publication.

NOTE: Although Dr. Ehlers think high of Cosine and Sine wave indicator and trading strategy, my study and trading experience indicated it did not work that well as many other oscillator indicators. However, I would like to keep the original code of Dr. Ehlers for anyone who want to make a deep dive into this kind of indicator or strategy with Cosine and Sine wave.



Readme

In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.

The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.

Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.

Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.

Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.

Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.

Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.
bandpassfilterdominantcycleehlersjohnehlersOscillatorsTrend Analysis

Skrypt open-source

W prawdziwym duchu TradingView autor tego skryptu opublikował go jako open source, aby inwestorzy mogli go zrozumieć i zweryfikować. Pozdrowienia dla autora! Możesz go używać bezpłatnie, ale ponowne użycie tego kodu w publikacji podlega Zasadom Regulaminu. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Chcesz użyć tego skryptu na wykresie?


Avoid losing contact!Don't miss out! The first and most important thing to do is to join my Discord chat now! Click here to start your adventure: discord.com/invite/ZTGpQJq 防止失联,请立即行动,加入本猫聊天群: discord.com/invite/ZTGpQJq
Również na:

Wyłączenie odpowiedzialności