• Home
  • Forums
  • News
  • Calendar
  • Market
  • Login
  • Join
  • User/Email: Password:
  • 11:39pm
Menu
  • Forums
  • News
  • Calendar
  • Market
  • Login
  • Join
  • 11:39pm
Sister Sites
  • Metals Mine
  • Crypto Craft
  • Forex Factory

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

What is A book vs B book in Forex trading? 30 replies

A book forex brokers VS B book brokers, differences? 12 replies

Traders' Book Club 10 replies

The Book Club 5 replies

  • Trading Discussion
  • /
  • Reply to Thread
  • Subscribe
  • 1,427
Attachments: The Finance Book Club
Exit Attachments
Tags: The Finance Book Club
Cancel

The Finance Book Club

  • Last Post
  •  
  • 1 5051Page 525354 61
  • 1 51Page 5253 61
  •  
  • Post #1,021
  • Quote
  • Dec 30, 2022 6:07pm Dec 30, 2022 6:07pm
  •  clemmo17
  • Joined Jul 2016 | Status: Member | 2,215 Posts
Chapter 5 - Band-Pass Filters

  1. A band-pass filter is both a detrender and a smoother combined
  2. Attenuation of out-of-band frequencies is superior to high-pass and low-pass filters because the ‘rejection’ is scaled to the bandwidth of the filter
  3. A band-pass filter tuned to a ‘consistent dominant cycle’ (a unicorn!) has no lag
  4. A narrow pass-band filter is slower to react to changes in the input data. A wider pass-band filter adapts more quickly to changes in the input data.
  5. The dominant cycle period of the data can be estimated by counting the number of bars between zero crossings of the band-pass filter output.

Attached Image (click to enlarge)
Click to Enlarge

Name: pasted image 0.png
Size: 69 KB

“Note the band-pass filter correctly identifies the peaks and valleys in the data. However, the band-pass filter is dead wrong when the prices go into a trend as in March 2012 and June and July 2012.”
 
1
  • Post #1,022
  • Quote
  • Edited 8:30pm Dec 30, 2022 6:34pm | Edited 8:30pm
  •  clemmo17
  • Joined Jul 2016 | Status: Member | 2,215 Posts
Chapter 6 - Market Structure and the Hurst component

  1. White noise has no correlation in time
  2. Random walk (Brownian motion) has no correlation between increments (of what?)
  3. Brownian walks can be generated

    1. With a function whose spectral density (defined later) is 1/F α where

      1. F is frequency
      2. α is a power law
      3. α = 1 signifies a long memory


    2. 1/F noise is synonymous with long-range dependence


  4. The ubiquity of 1/F α noise is one of the oldest puzzles of contemporary physics and science in general.


Attached Image (click to enlarge)
Click to Enlarge

Name: pasted image 0.png
Size: 62 KB


“These models are simply relevant to physically plausible situations.” But is the market price a physical system?

  1. Economic events some distance in the past continue to have an influence on current prices (proved by Mandelbrot)
  2. The Hurst coefficient is one way to attempt to get a handle on the slope of the power density of market data. (again a favorite of Mandelbrot)

    1. Varies from 0 to 1
    2. H = 1 - α/2; more ‘estimated’ than computed
    3. H = 2-D where D is the fractal dimension
    4. No predictive value for trading
    5. The H coefficient changes dramatically with the length of data used to estimate


  3. A value of 0.5 indicates a true random walk (a Brownian time series). In a random walk there is no correlation between any element and a future element. A coefficient between 0.5 and 1 indicates “persistent behavior,” that is, a long-term dependence.
  4. 0-0.5 is ‘antipersistent’ or countertend


The Hurst Coefficient in Action
Ehlers tells us that “the Hurst coefficient can be used to define trend modes (> 0.5) and cycle modes (< 0.5) in the market relative to the selected input length.” Cycle periods shorter than the hurst coefficient input parameter display as antipersistent; longer cycle periods display as persistent.

Attached Image (click to enlarge)
Click to Enlarge

Name: pasted image 0 (1).png
Size: 63 KB

Ehlers begins by showing a chart with the fractal dimension length of 30. It doesn't seem very useful?

Attached Image (click to enlarge)
Click to Enlarge

Name: pasted image 0 (2).png
Size: 59 KB

Then he shows us one with length 200. This looks like magic. The Hurst line jumps up above 0.5 well before any sign of bullish action, and then the bull trend begins. I’m a little concerned by how it remains flat between June and July when there was another big jump in price though.
I’m also wary of indicators whose usefulness fluctuates wildly based on input values. What if we used a filter length of 400? 4000? Well, I can answer that; we get wildly different interpretations. As Ehlers says, "Cycle Periods Shorter than the Hurst Coefficient Input Parameter Display as Antipersistent; Longer Cycle Periods Display as Persistent".

I am still working on an indicator that will not freeze the terminal. However, as Parisboy has opened our Christmas present a bit early, we might as well speed on towards the main course.
 
1
  • Post #1,023
  • Quote
  • Dec 30, 2022 6:59pm Dec 30, 2022 6:59pm
  •  clemmo17
  • Joined Jul 2016 | Status: Member | 2,215 Posts
Chapter 7 - Spectral Dilation

  1. Linear system theory says any problem can be divided into three boxes

    1. Input box
    2. Transfer box
    3. Output box


  2. Ehlers almost defines ‘spectral dilation’ here but not quite. You be the judge.
  3. “The transfer box can be as complex as desired and can be composed of many less complex boxes wired together. For this reason, I assumed that if I applied a filter to input data the output would contain only frequency components defined by the filter. I have certainly been aware of the fractal nature of market data and the log spiral used by Fibonaccians, but it just did not occur to me that the concept would extend to the frequency range of swing-trading filters.

I coined the term Spectral Dilation to encapsulate the significance of the effect. (what effect??) This effect has a profound influence on all technical indicators and is commonly neglected because these indicators are not viewed from the perspective of their frequency content.” (???)

Attached Image (click to enlarge)
Click to Enlarge

Name: pasted image 0.png
Size: 72 KB

“While the roofing filter indicator wiggles in proportion to the wiggles in the price data as you would expect, it is noticeable that the indicator is above zero for extended periods where the market is in an uptrend.”
My first reaction was to scoff, but Ehlers goes on to say this is just a warmup, and instead pivots to this Zero Mean Roofing Filter.
Attached Image (click to enlarge)
Click to Enlarge

Name: pasted image 0 (1).png
Size: 77 KB

But this looks far far worse! Am I supposed to trade the zero crosses with this thing?

But don’t worry, we just need to “add more generality by allowing the high-pass and low-pass critical periods to be supplied as indicator inputs” then we get an indicator.

Attached Image (click to enlarge)
Click to Enlarge

Name: pasted image 0 (2).png
Size: 75 KB

Like so.
What do we think of this?
Ehlers is proud of his achievement. “A casual glance shows the roofing filter to be an excellent indicator whose signals are not marred by computational lag.“ "This indicator gives excellent guidance for discretionary trading, but additional rules would be required to create a good mechanical trading system from it."
There's always more rules needed, it seems. Well, this is testable.
Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 20 KB
I simply marked the line crossings. The red line is the trigger, when it ducks under or over the blue line. The results are nearly identical. You might try to improve this by insisting on more space between the two lines after crossover. I think what you really need is an 'anticipation rule' where you estimate the most likely low and high values for the roofing filter, but as this isn't a formal oscillator the top and bottom cutoffs would be arbitrary and dependent on the instrument and timeframe.
Attached File(s)
File Type: mq4 EhlersRoofingFilter.mq4   9 KB | 43 downloads
 
1
  • Post #1,024
  • Quote
  • Edited 8:22pm Dec 30, 2022 7:42pm | Edited 8:22pm
  •  clemmo17
  • Joined Jul 2016 | Status: Member | 2,215 Posts
“Conventional indicators are not immune to the effects of spectral dilation. For example, a Stochastic indicator remains near its upper bound when the market is in an uptrend even though a relatively short lookback period is used. This, of course, is due to the presence of the larger and longer cyclic components in the data.” Ah, now I think I’m beginning to understand. This is Hurst’s (JM Hurst) theory about why trends exist. The 'spectral dilation' is caused by the sum of greater cycles in the price data?

“The Stochastic indicator basically displays the current closing price relative to the highest and lowest values in the lookback range. If you stop and think about it, the current price will tend to be in the high end of the range when the market is in an uptrend.” (and so maybe the way I'm testing this (below) is invalid. How can we do better?)

Attached Image (click to enlarge)
Click to Enlarge

Name: pasted image 0.png
Size: 90 KB

Spectral Dilation removal has a dramatic impact on the stochastic indicator

“The interpretation and use of the Stochastic indicator, or any other indicator, preceded by the roofing filter will not be addressed. Those kinds of applications can fill books all by themselves. Therefore, I will leave it to the reader to explore how standard indicators can be improved simply by inserting the roofing filter before the indicator computations are begun.” Oh, he could have given us at least one freebie. I fail to see how the stochastic has been improved by this pre-filtering; do you?
Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 20 KB
Even using the anticipation rule I can see this is going to give similar results as before. The trend is down. "It's a bear market, you know." says Old Partridge.
Attached File(s)
File Type: mq4 roofing stochastic 2.mq4   3 KB | 42 downloads
 
1
  • Post #1,025
  • Quote
  • Dec 30, 2022 7:47pm Dec 30, 2022 7:47pm
  •  clemmo17
  • Joined Jul 2016 | Status: Member | 2,215 Posts
Ehlers then applies this pre-filtering idea to a modified RSI.
I'm including it here for you to test and report back.

  1. Spectral Dilation is inherently part of market data, arising from the fractal nature of the data. That is, longer cycle periods necessarily have correspondingly larger amplitude swings.
  2. Spectral Dilation is virtually ignored in all common technical indicators. (Is it ignored or there’s simply no known way to deal with infinite variance?)
  3. Ignoring Spectral Dilation has led to erroneous, and often wacky, interpretations of market activity.
  4. Spectral Dilation can be corrected by placing a roofing filter before the computation of indicators. (From the testing I’ve done so far I think ‘corrected’ should be in quotes. Still, it was hastily done. Please report if you find a use for it.)
  5. A roofing filter establishes a near zero mean of detrended data by allowing only cyclic components within the filter pass band to be passed on for further analysis.
  6. The roofing filter, itself, can be a successful technical indicator. (It would be great if he explained how.)
  7. Insertion of the roofing filter will dramatically change the use and interpretation of standard indicators, basically making them all new indicators. (New, but the same dependable uselessness for live trading?)

Next: hopefully before the new year: the autocorrelation periodogram which is the 'main course' of this book(?)

Attached File(s)
File Type: mq4 Ehlers Mod RSI 1.0.mq4   11 KB | 34 downloads
 
2
  • Post #1,026
  • Quote
  • Dec 31, 2022 11:56am Dec 31, 2022 11:56am
  •  clemmo17
  • Joined Jul 2016 | Status: Member | 2,215 Posts
Chapter 8 - Autocorrelation Periodogram
“The autocorrelation process yields a number of unique and useful indicators. Autocorrelation is a simple concept. The most recent data stream of a ticker symbol is correlated with a data stream of that same ticker symbol delayed by a parameter called lag. This computation is important to traders because unconventional processing leads to ascertaining the periodicity of the price data without the distortion of Spectral Dilation. Autocorrelation also leads to some particularly insightful turning point signals.” (Simple as pie, Johnny. That’s what you do, you keep it simple for us stupids.)

  1. Peter Swerling, engineer

    1. Developed a class of statistically fluctuating target scattering models in the 1950s for pulsed radar systems
    2. He noticed return radar echoes were noisy
    3. This was caused by reflections from the different parts of the airplane as its aspect changed relative to the radar transmitter


  2. The Swerling model is entirely consistent with the 1/F α spectral model that uses random inputs with long-term memory.
  3. There has been a mountain of opinion regarding the randomness of the market

    1. It is reasonable to apply a Swerling-like model toward the generation of synthetic data.


  4. We can gain insight into market activity by correlating current prices with prices in the recent history to take advantage of the memory part of the model.
  5. “One of the underlying principles of technical analysis is that market data do not follow this power law of an efficient market, and we therefore can extract information from the partial correlation of the autocorrelation function.”
  6. “Market data are considerably messier than purely random numbers or perfect sine waves but contain features of both. However, the characteristics that are uncovered by autocorrelation offer unique trading perspectives. Since the process is relatively complicated, describing how the computer code in Code Listing 8-2 works is the best path toward understanding.” (It’s easier to show than to tell, sometimes. However in this case, neither is easy.)
  7. Market cycles are not consistent
  8. From what I can understand the indicator is made up of a heat map, which is meant to show cycle strength from black (weakest) to yellow (strongest). There is also a ‘spectral estimate’ of the dominant cycle made using a centre-of-gravity algorithm. I’m going to skip all the technical details which run for several pages.
  9. The dominant cycle is a value that varies with time and can be used to automatically tune other indicators such as the band-pass filter, commodity channel index (CCI), relative strength index (RSI), Stochastic, and so on. And now we get some sense of Ehlers grand plan. He has built some cool indicators, and the ‘tuning fork’ with which to optimize them (protect them from ‘spectral dilation’), at least in theory!
  10. The vertical scale is the cycle length in terms of number of bars.
  11. The spectrum display is equally applicable to intraday data as it is to daily or weekly data.
  12. “It is obvious from the spectrum display that market cycles are evanescent—they come and go and change their periodicity over time.” (uh-oh!!)


Attached Image (click to enlarge)
Click to Enlarge

Name: 01.png
Size: 62 KB

Autocorrelation periodogram for DG.

Ehlers then goes on to produce the ‘Autocorrelation Reversals’ indicator.
Attached Image (click to enlarge)
Click to Enlarge

Name: pasted image 0.png
Size: 94 KB

Autocorrelation Reversals
The LPLength of the first subgraph has a length of 20. The second, 10. That one is more suited to active trading holding for days to a week.

Key points
1. The autocorrelation periodogram has the least latency of all market data spectral estimates.
2. The autocorrelation periodogram automatically estimates the total cyclic power in the data as a function of time.
3. The autocorrelation periodogram provides an accurate estimate of the market spectrum without the need for compensation for Spectral Dilation. (bold!)
4. The autocorrelation periodogram resolution is independent of any windowing function of the price data.
5. Price reversals are indicated by a dramatic switch in correlations at all values of lag. These reversals can be used as a reliable indicator.

I have a few things to say about this, but it will have to be after the new year. I will leave you with a copy of the autocorrelation periodogram to ponder. I cannot locate an autocorrelation reversals indicator, so unless someone can give us a tip, it will have to be constructed from scratch. If anyone wants to attempt that under time duress, please be my guest.

Inserted Code
{
    Autocorrelation Reversals
    :copyright: 2013 John F. Ehlers
}
Inputs:
    HPLength(48),
    LPLength(10),
    AvgLength(3);
Vars:
    alpha1(0),
    HP(0),
    a1(0),
    b1(0),
    c1(0),
    c2(0),
    c3(0),
    Filt(0),
    M(0),
    N(0),
    X(0),
    Y(0),
    Lag(0),
    count(0),
    Sx(0),
    Sy(0),
    Sxx(0),
    Syy(0),
    Sxy(0),
    SumDeltas(0),
    Reversal(0);
Arrays:
    Corr[48, 2](0);
//Highpass filter cyclic components whose periods are shorter than 48 bars
alpha1 = (Cosine(.707*360 / 48) + Sine (.707*360 / 48) - 1) / Cosine(.707*360 / 48);
HP = (1 - alpha1 / 2)*(1 - alpha1 / 2)*(Close - 2*Close[1] + Close[2]) + 2*(1 - alpha1)*HP[1] - (1 - alpha1)*
(1 - alpha1)*HP[2];
//Smooth with a Super Smoother Filter from equation 3-3
a1 = expvalue(-1.414*3.14159 / LPLength);
b1 = 2*a1*Cosine(1.414*180 / LPLength);
c2 = b1;
c3 = -a1*a1;
c1 = 1 - c2 - c3;
Filt = c1*(HP + HP[1]) / 2 + c2*Filt[1] + c3*Filt[2];
//Pearson correlation for each value of lag
For Lag = 3 to 48 Begin
    Corr[Lag, 2] = Corr[Lag, 1];
    //Set the averaging length as M
    M = AvgLength;
    If AvgLength = 0 Then M = Lag;
    //Initialize correlation sums
    Sx = 0;
    Sy = 0;
    Sxx = 0;
    Syy = 0;
    Sxy = 0;
    //Advance samples of both data streams and sum Pearson components
    For count = 0 to M - 1 Begin
       X = Filt[count];
       Y = Filt[Lag + count];
       Sx = Sx + X;
       Sy = Sy + Y;
       Sxx = Sxx + X*X;
       Sxy = Sxy + X*Y;
       Syy = Syy + Y*Y;
    End;
    //Compute correlation for each value of lag
    If (M*Sxx - Sx*Sx)*(M*Syy - Sy*Sy) > 0 Then Corr[Lag, 1] = (M*Sxy - Sx*Sy)/SquareRoot((M*Sxx - Sx*Sx)*(M*Syy - Sy*Sy));
    //Scale each correlation to range between 0 and 1
    Corr[Lag, 1] = .5*(Corr[Lag, 1] + 1);
End;
SumDeltas = 0;
For Lag = 3 to 48 Begin
    If (Corr[Lag, 1] > .5 and Corr[Lag, 2] < .5) Or (Corr[Lag, 1] < .5 and Corr[Lag, 2] > .5) Then SumDeltas = SumDeltas + 1;
End;
Reversal = 0;
If SumDeltas > 24 Then Reversal = 1;
Plot1(Reversal);

Wishing you the best in 2023!
Attached File(s)
File Type: mq4 AutocorrelationPeriodogram v5.1.mq4   10 KB | 40 downloads
 
2
  • Post #1,027
  • Quote
  • Edited 1:41pm Dec 31, 2022 1:13pm | Edited 1:41pm
  •  parisboy
  • Joined Oct 2017 | Status: Member | 9,303 Posts
It is obvious from the spectrum display that market cycles are evanescent—they come and go and change their periodicity over time.”

I like this one very much !

Life is hard for the Cycles Analyst !

As soon as identified Cycles disappear without warning and reappear later without warning too.

When Cycles do not disappear without warning, they change their periodicity ( I suspect that it is only to destabilize readers of this thread and Cycle Analysts ! )

By the way when Cycles change their periodicity, they change their Amplitude too !

My comments and charts next year !

Happy New Year !
 
2
  • Post #1,028
  • Quote
  • Jan 1, 2023 8:29am Jan 1, 2023 8:29am
  •  Ieis5
  • | Joined May 2021 | Status: Member | 104 Posts
Quoting parisboy
Disliked
. Ehlers is not a trader, he mainly writes books, (challenging, stimulating) but of very few interest for trading. Moreover his pet idea is that to reduce the "lag" of a MA by using sophisticated unapplicable by most people or/ and platforms.
Ignored
This is of course completely false. And there is no mathematical justification for your Centered Moving Averages.
 
 
  • Post #1,029
  • Quote
  • Edited 11:21am Jan 1, 2023 10:00am | Edited 11:21am
  •  parisboy
  • Joined Oct 2017 | Status: Member | 9,303 Posts
Ehlers Tools and Methodologies have (almost) zero interest in trading as shown by the differrent charts posted by Clemmo 17

........ because they are inadapted to the real Price Action of EURUSD Daily as shown by the same charts.
Attached Image(s) (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 99 KB
Click to Enlarge

Name: screenshot.png
Size: 132 KB
Click to Enlarge

Name: screenshot.png
Size: 92 KB
Click to Enlarge

Name: screenshot.png
Size: 120 KB
Click to Enlarge

Name: screenshot.png
Size: 100 KB
 
 
  • Post #1,030
  • Quote
  • Jan 1, 2023 10:08am Jan 1, 2023 10:08am
  •  parisboy
  • Joined Oct 2017 | Status: Member | 9,303 Posts
Quoting Ieis5
Disliked
{quote} This is of course completely false. And there is no mathematical justification for your Centered Moving Averages.
Ignored
It would be a waste of time and energy to answer you
 
 
  • Post #1,031
  • Quote
  • Edited 10:53am Jan 1, 2023 10:40am | Edited 10:53am
  •  parisboy
  • Joined Oct 2017 | Status: Member | 9,303 Posts
If you agree that the Envelope 32 Time Units based on a Centered Moving Average 32 Time Units includes "most of" the day to day EURUSD fluctuations , the Amplitude of this Envelope is 0,04

Hence the Amplitude of the Day to Day fluctuations deals with only 15 % of the Downtrend whose Amplitude is 0,28

Ehlers Tools shown by Clemmo 17 deals at best with 15 % of Price Action and not the most important part for an investor or a trader
Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 57 KB
 
 
  • Post #1,032
  • Quote
  • Jan 2, 2023 1:33am Jan 2, 2023 1:33am
  •  clemmo17
  • Joined Jul 2016 | Status: Member | 2,215 Posts
Quoting Ieis5
Disliked
{quote} This is of course completely false. And there is no mathematical justification for your Centered Moving Averages.
Ignored
This certainty would be more persuasive if it could be accompanied with evidence. Ehlers is highly respected by some famous traders though.

"It’s refreshing to find new ideas in a business that’s become so competitive and often filled with variations on the same theme."
– PERRY KAUFMAN
{
"If John Ehlers writes it, I read it. He’s that brilliant."
– LARRY WILLIAMS
{
"John is one of those rare breed of analysts who dives into the why and how of thing and not the often used superficial approach."
– GREG MORRIS
{
"John Ehlers ranks with Art Merrill as the best quantitative analyst of the twentieth and probably the twenty-first century."
– JOHN SWEENEY

His engineering pedigree is also very impressive. I doubt we can know the status of his trading; he must be in his 80s now, and probably retired. Still, I note that Ehlers did not manage a hedge fund, and he is not on the Forbes list, nor are any of the most prominent technical analysis gurus. That doesn't mean much though, except that there are probably more successful ways to make money besides trading.

The purpose of our inquiries is purely about the joy of discovery, not so much settling any debate, which is probably impossible. As for how to 'mathematically justify' (or invalidate) any tool in trading, I am curious to know what method you propose for doing so.
 
2
  • Post #1,033
  • Quote
  • Jan 2, 2023 2:33am Jan 2, 2023 2:33am
  •  clemmo17
  • Joined Jul 2016 | Status: Member | 2,215 Posts
I would like to spend a little time here on Chapter 8, with the periodogram.
1. Ehlers spends several chapters to get to this point and the techniques that he uses to build it are based on preceding filters. He is also fairly self-congratulatory in his description of its properties.
2. The periodogram is not like the other indicators that we have seen, and in fact it's quite different from most indicators whose function is to anticipate price direction or amplitude. The periodogram, as its name implies, is designed to measure cycle periodicity.

The main problem with cycle analysis, as I see it, is that trading cycles are too 'evanescent' to be of much use. If they don't recur on a timely basis we can be either too early or too late to get in at the right time. Also 'spectral dilation' or the 'sum of greater cycles' or 'the trend' is always working against us if we choose to be trend agnostic. Anyone who has tried to trade using indicator signals has likely experienced some of this, and its frustrating consequences. However at least one person has confidently told me that they make all their trading decisions using a simple layering of 4 different moving averages of different filter lengths. And I'm sure they're not lying; it probably works out well for them if they have taken other necessary precautions.

The eternal question though, is what filter lengths to select? What is optimal?

But now we have the periodogram which promises to settle the debate about what frequency we should tune our filter lengths to, and it promises to show us the dominant cycle in price history. This in turn promises to remove some of the uncertainty surrounding how to use indicators in trading.

Ehlers has set the scene masterfully. He has instructed us in the science of digital signals, at least some basics, and he has given us some indicators, like the decycler oscillator, or the roofing RSI or roofing Stochastic that can be tuned using the periodogram, and so possibly deliver superior trading performance, free from spectral dilation.

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 58 KB
When you apply it with default settings this is what you see on EURUSD H1.

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 5 KB
The LowPass Length and HighPass Length are taken directly from the book.
"About the shortest cycle period useful for trading is a 10-bar cycle, and cycle periods longer than 48 bars can often be considered trends." "This value was selected because it is more than two months of daily data and is four hours of five-minute intraday bars. It is unlikely that longer waves would have a beneficial impact on cyclic trading." The original version of the indicator intended these values to be constants. However this then means that no cycle longer than 48 bars can be found by the indicator. Similarly, no cycle shorter than 10 bars can be found. Ehlers again has a reason for this. "The 10-bar period for this filter was selected for practical trading reasons. Think of it this way: The shortest period possible to use (the Nyquist frequency) has only two samples per period. If you were trading this period and got a high sample, you could enter only on the next bar at the low sample. This would be an easy trade if the cycle period were consistent, but market cycles are not consistent. The situation is not much better at cyclic components an octave slower at four bars per period. There is just not enough time to get the signal and then implement the trade. At another octave slower at eight samples per cycle, one can start to consider rapid trading because there are several bars of follow-through after the signal is obtained. In a perfect world, you would be trading as often as every four bars—one half of the shortest useful cyclic period."

But these values seem fairly arbitrary to me.
Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 60 KB
USDCAD H1

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 64 KB
USDCAD D1

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 57 KB
XAUUSD W1

You see in every case a maximum cycle of 48 and a mininum cycle of 10 is possible.
For now though, let's assume Ehlers is correct and longer cycles are not useful, nor shorter ones. If we disagree later one we can try different low and high pass values.
 
 
  • Post #1,034
  • Quote
  • Jan 2, 2023 2:42am Jan 2, 2023 2:42am
  •  clemmo17
  • Joined Jul 2016 | Status: Member | 2,215 Posts
The next number of interest is the 'average length'. This was meant to be the only input into the indicator.

"[It] is the length over which the averaging is to be done. With the default value of zero, the averaging length is equal to each lag. That way, the averaging contains the maximum number of data samples without overlapping the original data stream and the lagged data stream. "
However you can see from the code the default value is not zero, but 3. And adjusting this value gives wildly varying results.

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 56 KB
EURUSD D1 - avgLength 0

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 59 KB
EURUSD D1 - avgLength 3

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 59 KB
EURUSD D1 - avgLength 6

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 58 KB
EURUSD D1 - avgLength 12

Each one is very different, within the limits of the 10-48 bar cycle governor. It seems we need a periodogram for the averaging length. Still, let's stick with the code default of 3.
 
 
  • Post #1,035
  • Quote
  • Jan 2, 2023 2:55am Jan 2, 2023 2:55am
  •  clemmo17
  • Joined Jul 2016 | Status: Member | 2,215 Posts
The indicator has two main parts - the heat map and the 'time-frequency representation' (TFR) which is the yellow line that marks the average period of the dominant cycle.

The heat map looks cool but its main function is simply to show the degree of correlation between past prices. This is a measurement of the 'memory' effect of past price on later prices. When there is a white hot/yellow spot at the TFR value, that's a dominant cycle. When the cycle is in black or red space it's less 'dominant' and presumably, less useful.

Here is the first sad panda moment for the aspiring cycles trader using Ehlers methods because it seems apparent, to me at least, that the most 'dominant' cycles are also the most 'evanescent'. As soon as a cycle gets white hot it decays and moves to a different value. In contrast, the stable cycles that persist over time (the flat horizontal lines) are mainly in dark space. That's not always the case, but it seems to match my own experience.

Looking at the TFR, we see that it also hops around a lot, but in many instruments recent price seems to have some stable cyclicality.

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 19 KB

EURUSD D1 -stable 14-15 period cycle

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 54 KB
GBPUSD D1 - almost the same value

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 24 KB
USDCAD D1 - was stable at 24 or so but appears to have hopped away.

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 11 KB
AUDUSD D1 - again around 14 but cooling off fast?

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 14 KB
AUDNZD D1 - something a bit different around 22 but cooled down.
 
 
  • Post #1,036
  • Quote
  • Jan 2, 2023 3:19am Jan 2, 2023 3:19am
  •  clemmo17
  • Joined Jul 2016 | Status: Member | 2,215 Posts
Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 44 KB
AUDNZD D1

Now that we have some approximate periods to use for "automatically tuning other indicators", why don't we see what we get when we use the RSI, both Ehlers modified version and the standard one that comes with MT4.

I'm using here a period of 22, as fractional periods are not allowed with RSI. I'm also using an even number of periods, which maybe Hurst purists might object to? I'm not sure. I'm also not sure if I should be using only 1/2 the value of the dominant cycle (11) but that applies only to shifting of FLD lines? I might be mis-remembering. It has been a while since I read 'Profit Magic'.

What I see is a brilliant short entry for the RSI, and possibly a good entry for a future long. Encouraging, but it's only 2 data points. A bit of garbage from the modified RSI.

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 48 KB
EURUSD D1
Using the current dominant cycle around 14 I don't see any useful signal. If we had started further back using an older dominant cycle, it looks like there is again one good RSI signal.

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 66 KB
If I zoom out I see there has been a strong TFR period around 35-38 in history. If I tune the RSI to that value, I get garbage from the modified RSI and indecision from the RSI.
 
 
  • Post #1,037
  • Quote
  • Jan 2, 2023 3:44am Jan 2, 2023 3:44am
  •  clemmo17
  • Joined Jul 2016 | Status: Member | 2,215 Posts
Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 28 KB
USDCAD D1
If I use the dominant cycle period of 19 going back a few months I get one decent short signal on RSI, and also maybe the modified RSI which gets us out possibly at a better time?

Notice that the cycle changes midway through the trade, going to 24, but this hardly affects the RSI indicators at all.

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 67 KB
If I zoom out and use the higher cycle period of late 2019 I get one good signal from the RSI. The rest of the year and following years it is indecisive. This doesn't change even if I gear down to 34 in May 2020.

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 39 KB
If I gear down further to about 19 at the end of 2020, depending on when I do so I might get one good long signal, or possibly 1 bad, and 1 good. Either way this lower frequency seems to look better than the higher ones in recent times. If you want more trades you'd need an anticipation rule with trigger values lower than 70 and higher than 30. It seems like it could work. Notice that from mid 2021, price is ranging and stationary, something I associate with cycle stability. No spectral dilation!
 
 
  • Post #1,038
  • Quote
  • Jan 2, 2023 3:54am Jan 2, 2023 3:54am
  •  clemmo17
  • Joined Jul 2016 | Status: Member | 2,215 Posts
Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 12 KB
XAUUSD D1
Gold has a cycle around 19. It seems like most everything is around 18-21 on the daily charts.
You'd get no signals or maybe one short signal that I'm not crazy about.

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 69 KB
If I zoom out, and pick a cycle that has been perenially popular around the 18-19 day mark I get a few signals. One or two of them might be initially frustrating but they eventually work out. I'm not sure most traders could hold trades this long though.

The modified RSI is really not helpful. I wonder if this version has a bug? Maybe we should switch to stochastic?
 
1
  • Post #1,039
  • Quote
  • Jan 2, 2023 4:09am Jan 2, 2023 4:09am
  •  clemmo17
  • Joined Jul 2016 | Status: Member | 2,215 Posts
Let's look at
Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 62 KB

CHFJPY D1

If I zoom out and pick a popular historical cycle of 23, the RSI gives a series of short signals in an uptrend. Not ideal, but these countertrend trades might have worked out if you had a sensible exit rule. Maybe the modified RSI works better in this case? It gets you into a long trade, and looks good in some places.

Anyway, I could actually go on like this for days, and there is no shortage of things to try. Different pass lengths, different averaging lengths, different timeframes and different instruments. Not to mention different signalling indicators.

In the end it might not prove anything. What I cannot do though, is dismiss this notion of Ehlers entirely, which is not often the case in the Book Club.

I already said that cycles are real, just aperiodic, but maybe they are similar enough between instruments that we can stick to a few well-trod values and improve the performance of some commonly used indicators, whatever your preference might be. This could possibly be helpful.

I would say being on the correct side of the trend is still more important, but hasn't that always been the case? Also it seems that some instruments are simply more 'cyclical' than others and this works better with them than with something in a secular trend.

Now I'm just wondering if I've left anything unsaid or if you have any feedback about this? Since this wasn't a total disaster I'm going to finish the book.
 
1
  • Post #1,040
  • Quote
  • Jan 2, 2023 6:01am Jan 2, 2023 6:01am
  •  clemmo17
  • Joined Jul 2016 | Status: Member | 2,215 Posts
Chapter 9 - Fourier Transforms.

This chapter is basically all about how Fourier Transforms are too laggy to use in trading, but Ehlers is so clever that he 'bludgeons' the math to make it work by converting it into a Discrete Fourier Transform (DFT). Despite this, he recommends sticking with the periodogram. I will take his word for it.

Key points
1. The practical computation of a DFT for market data disregards theoretical requirements. (i.e. it doesn't work)
 
1
  • Trading Discussion
  • /
  • The Finance Book Club
  • Reply to Thread
    • 1 5051Page 525354 61
    • 1 51Page 5253 61
1 trader viewing now
  • More
Top of Page
  • Facebook
  • Twitter
About EE
  • Mission
  • Products
  • User Guide
  • Blog
  • Contact
EE Products
  • Forums
  • Calendar
  • News
  • Market
EE Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow EE
  • Facebook
  • Twitter

EE Sister Sites:

  • Metals Mine
  • Crypto Craft
  • Forex Factory

Energy EXCH™ is a brand of Fair Economy, Inc.

Terms of Service / ©2023