TradingView
loxx
14 cze 2022 07:37

Ehlers Autocorrelation Periodogram [Loxx] 

Euro Fx/U.S. DollarFXCM

Opis

Ehlers Autocorrelation Periodogram [Loxx] contains two versions of Ehlers Autocorrelation Periodogram Algorithm. This indicator is meant to supplement adaptive cycle indicators that myself and others have published on Trading View, will continue to publish on Trading View. These are fast-loading, low-overhead, streamlined, exact replicas of Ehlers' work without any other adjustments or inputs.

Versions:
- 2013, Cycle Analytics for Traders Advanced Technical Trading Concepts by John F. Ehlers
- 2016, TASC September, "Measuring Market Cycles"

Description
The Ehlers Autocorrelation study is a technical indicator used in the calculation of John F. Ehlers’s Autocorrelation Periodogram. Its main purpose is to eliminate noise from the price data, reduce effects of the “spectral dilation” phenomenon, and reveal dominant cycle periods. The spectral dilation has been discussed in several studies by John F. Ehlers; for more information on this, refer to sources in the "Further Reading" section.

As the first step, Autocorrelation uses Mr. Ehlers’s previous installment, Ehlers Roofing Filter, in order to enhance the signal-to-noise ratio and neutralize the spectral dilation. This filter is based on aerospace analog filters and when applied to market data, it attempts to only pass spectral components whose periods are between 10 and 48 bars.

Autocorrelation is then applied to the filtered data: as its name implies, this function correlates the data with itself a certain period back. As with other correlation techniques, the value of +1 would signify the perfect correlation and -1, the perfect anti-correlation.

Using values of Autocorrelation in Thermo Mode may help you reveal the cycle periods within which the data is best correlated (or anti-correlated) with itself. Those periods are displayed in the extreme colors (orange) while areas of intermediate colors mark periods of less useful cycles.

What is an adaptive cycle, and what is the Autocorrelation Periodogram Algorithm?
From his Ehlers' book mentioned above, page 135:
"Adaptive filters can have several different meanings. For example, Perry Kaufman’s adaptive moving average ( KAMA ) and Tushar Chande’s variable index dynamic average ( VIDYA ) adapt to changes in volatility . By definition, these filters are reactive to price changes, and therefore they close the barn door after the horse is gone.The adaptive filters discussed in this chapter are the familiar Stochastic , relative strength index ( RSI ), commodity channel index ( CCI ), and band-pass filter.The key parameter in each case is the look-back period used to calculate the indicator.This look-back period is commonly a fixed value. However, since the measured cycle period is changing, as we have seen in previous chapters, it makes sense to adapt these indicators to the measured cycle period. When tradable market cycles are observed, they tend to persist for a short while.Therefore, by tuning the indicators to the measure cycle period they are optimized for current conditions and can even have predictive characteristics.

The dominant cycle period is measured using the Autocorrelation Periodogram Algorithm. That dominant cycle dynamically sets the look-back period for the indicators. I employ my own streamlined computation for the indicators that provide smoother and easier to interpret outputs than traditional methods. Further, the indicator codes have been modified to remove the effects of spectral dilation.This basically creates a whole new set of indicators for your trading arsenal."

How to use this indicator
The point of the Ehlers Autocorrelation Periodogram Algorithm is to dynamically set a period between a minimum and a maximum period length. While I leave the exact explanation of the mechanic to Dr. Ehlers’s book, for all practical intents and purposes, in my opinion, the punchline of this method is to attempt to remove a massive source of overfitting from trading system creation–namely specifying a look-back period. SMA of 50 days? 100 days? 200 days? Well, theoretically, this algorithm takes that possibility of overfitting out of your hands. Simply, specify an upper and lower bound for your look-back, and it does the rest. In addition, this indicator tells you when its best to use adaptive cycle inputs for your other indicators.

Usage Example 1
Let's say you're using "Adaptive Qualitative Quantitative Estimation (QQE) [Loxx]". This indicator has the option of adaptive cycle inputs. When the "Ehlers Autocorrelation Periodogram [Loxx]" shows a period of high correlation that adaptive cycle inputs work best during that period.

Usage Example 2
Check where the dominant cycle line lines, grab that output number and inject it into your other standard indicators for the length input.
Komentarze
gotbeatz26107
Just discovered this concept and tried to find it on tradingview. No wonders you did it better than anyone, thanks again!
slowcoconut
Seems as tho the masterdom variable -- dominant cycle line -- can be used as an input series for the length parameter of various other indicators, as you said in the usage example... I'll try it and report back -- looks promising...

as for the first usage -- can this indicator be tweaked to show just autocorrelation (-1 to 1) of an input source? I can tackle this, just curious if I should spend time going down that path... thanks loxx.
ramtk2000
@slowcoconut, To have the 'dominantCycle" as input to indicators using RSI, which accepts 'length' only as "simple Integer" how can we do? This script has 'dominantCycle' as Series...

Can anyone help please?

Thanks.
Yelian
@slowcoconut, Would love to hear about your follow up. The output of this script is the number of candles (unit of time) that is most relevant at any given time? Eg. if you're using the daily chart then the output is the number of daily candles (length of time) that is most relevant to the statistical behavior of the time series?
slowcoconut
@Yelian, Yes (in theory) .. and in practice its pretty good... costly function though but if you're not running much else the script should be fine...
and @ramtk2000 sorry I didn't see this earlier, I didn't get a noti --> just round to int and use as a length param
Więcej