STOCKS & COMMODITIES magazine. The Traders' Magazine

Register or Log In — Traders.com and STOCKS & COMMODITIES magazine

  |  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

NOT A SUBSCRIBER?

To continue reading, sign-up for trial access to Traders.com and the S&C Archive37,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.



DEPARTMENTS: Advertising | Editorial | Circulation | Contact Us | BY PHONE: (206) 938-0570

PTSK — The Professional Traders' Starter Kit
Home — S&C Magazine | Working Money Magazine | Traders.com Advantage | Online Store | Traders’ Resource
Add a Product to Traders’ Resource | Message Boards | Subscribe/Renew | Free Trial Issue | Article Code | Search

Copyright © 1982–2024 Technical Analysis, Inc. All rights reserved. Read our disclaimer & privacy statement.