| MAY 1992
Optimum Detrending by John F. Ehlers
Optimum Detrending by John F. Ehlers Look at any price chart, and you'll find that markets move up and down even while in a trend . Removing the trend can help identify short-term turning points. Frequent STOCKS & COMMODITIES contributor John Ehlers presents different techniques for detrending prices and his optimized detrending method as well. We want to detrend data because we want to remove the longer-term variations so short term turning points are easier to discern, enabling us to better pinpoint the best entry and exit points for short-term trades. Since the goal of detrending is separation of time variables, it is logical that we can optimize the calculation for our approach to the market. Short-term and long-term variations are synonymous with high frequency and low-frequency components, respectively. This is important because optimization is accomplished using modem digital filter theory. Using filters, we can readily separate the desired frequency components and discard the undesired frequency components. Short term and long term are relative to trading style. A 26-week cycle used by a stock trader is long term for a commodity trader using daily data, for example. Similarly, an intraday trader considers anything longer than several hours to be long term. The optimization we derive considers daily data, but the principles can be expanded for any trading situation. Before we optimize detrending, let us review conventional detrending techniques for their comparative strengths and weaknesses. CONVENTIONAL DETRENDING At least three different detrending techniques can be commonly found: First, calculating the best-fitting straight line as the trendline and subtracting the trendline from the raw data; second, calculating a moving average as a trendline and subtracting that trendline from the raw data; and third, taking the difference of two data points separated in time. The easiest way to calculate the best-fitting trendline is to draw a straight line between successive highest highs or lowest lows and then translate this line to the center of the data spread. The best-fitting straight line can also be calculated by linear regression, often desirable because nearby successive maxima cannot be clearly identified. But this calculation can have accuracy problems. The trendline of a perfect sine wave taken over one full cycle is exactly horizontal because the sine wave has as many points above zero as it does below zero. When we calculate the best-fitting straight line to a single sine wave cycle by linear regression, we get the result as seen in Figure 1. We would get the correct result if we took the span between successive peaks or valleys and would get the incorrect slope in the opposite direction if we took the span over the cycle with a 180-degree phase shift (Figure 2).
by John F. Ehlers
Technical Analysis of STOCKS & COMMODITIES
The Traders’ Magazine since 1982
has had over 1,226,237 subscribers from 174 different countries.
37,000 Page Traders’ Archive for $89.99
To continue reading, sign-up for trial access to Traders.com and the S&C Archive — 37,000 pages of trading ideas!
After verifying your email address, you will have limited access to the S&C Archive, as well as access to a Digital Edition of S&C, and access to Traders.com Advantage and Working Money for 30 days.
Not a subscriber to Technical Analysis of
STOCKS & COMMODITIES magazine?
Click
here to subscribe, or request
a trial subscription.
Log-in now to view articles from the S&C Archive.
Your Subscriber ID is located at the top of your magazine label, highlighted here in red.
Your last name can be found on the second line, highlighted here in blue.
*If you have a company name on the label, that can also be used. It will appear below your name on the label.
If you do not have a Subscriber ID on your label, you can find it on your statement or renewal form.
For help locating your Subscriber ID number, please call us at 1-800-832-4642 or send an email to Survey@Traders.com. If sending an email, please include your name and mailing address.