TRADING TECHNIQUES



Adaptive Trends And Oscillators


The Twain Meets Here


by John F. Ehlers

Can the market be modeled as a combination of a trend mode and a cycle mode? This longtime S&C contributor says yes. Here, he explores two indicators to trade each mode; one is the new, adaptive version of an indicator originally introduced in 1996, and it does well in trading ranges but steps aside in trends. With this new version, you can address both modes of the market without interfering with the other -- and that's something that traders have been waiting for.


Do you remember? As you were learning about trading, you probably realized somewhere along the way that oscillators don't work in trending markets, that trends and oscillators don't mix. You might have even come to that conclusion after long and hard analysis. But if you thought that was the end of the story, you would be wrong. Can the market be modeled as a combination of a trend mode and a cycle mode? Yes! Further, it would be helpful if the equations applying to these modes point directly to those technical analysis indicators that can exploit these modes. Here, then, are two indicators you can use to identify and trade each mode, including code that you can program yourself.

FIGURE 1: TREND TRADING. By using the instantaneous trendline (seen in yellow), it's straightforward to take a position if prices stay on one side of the line more than half the number of days in the instantaneous (Hilbert) frequency. Red bars show periods when that occurred, while blue bars are exit points.


But wait! There's more. By removing the cycle from the trendline and only looking at the cycle in the sinewave indicator, you can address both modes of the market without interfering with the other mode. You can do this with the new and improved version of the sinewave indicator, one that is adaptive and works to identify turning points in the cycle. This way, you can indeed combine trends and cycles.

First, let's look at trends and modes individually, and find out what they're all about. Then we'll examine how they can be combined.

TREND MODE TRADING:
THE INSTANANEOUS TRENDLINE

Traditionally, moving averages have been used to study trend mode because the moving average forms a visual trend of the data. By using a technical market model of a trend plus a dominant cycle, I created something I call an instantaneous trendline by removing the dominant cycle from the price information. I can do this because I measured the period of the dominant cycle using the technique I described in the March 2000 issue (see sidebar, "Using the Hilbert transform").

If you remove the dominant cycle component, what's left -- the average across the cycle -- is the residual. This filtered residual is the instantaneous trendline. This adaptive trendline looks like a simple moving average, but in this case, the period of the dominant cycle changes as we move across the chart, so the period of the simple average must change accordingly. The code given accomplishes this by examining each day of the last 40 days of data.

By itself, the instantaneous trendline doesn't beat lag; the trendline lag will always be half the period of the measured dominant cycle. The EasyLanguage code to compute the instantaneous trendline can be found in the sidebar, "Instantaneous trendline."


John F. Ehlers, Box 1801, Goleta, CA 93116, is an electrical engineer working in electronic research and development and has been a private trader since 1978. He is a pioneer in introducing maximum entropy spectrum analysis to technical traders through his MESA software. He may be reached at 805 969-6478, or via his Website at https://www.mesa-systems.com.

Excerpted from an article originally published in the May 2000 issue of Technical Analysis of STOCKS & COMMODITIES magazine. All rights reserved. © Copyright 2000, Technical Analysis, Inc.



Return to May 2000 Contents