Print Page

 | 

E-mail Page

The Gabriel Linear Regression Angle Indicator: A New Indicator for Intermediate-Term Trading

Knowledge Base ID: 1.9.49.3

Overview

This paper presents a new tool for market timing and intermediate-term trading, the Gabriel Linear Regression Angle Indicator (GLRA). The GLRA Indicator is based on information provided by the Linear Regression Line Function, but overcomes a weakness of that parameter of a price series when it is exclusively relied on for investment decisions. The argument which follows outlines the genesis of the GLRA Indicator, sets forth its theoretical basis, and demonstrates its effectiveness when used to trade a variety of financial instruments, including individual equities, mutual funds, and indices. Furthermore, the mathematical and programming information necessary for the calculation and graphic representation of the GLRA Indicator is provided so that other technicians can evaluate the claims made here for its effec tiveness.

The linear Regression line

Most technical analysis software packages allow the technician to plot a linear regression line over the price action of a security, mutual fund, or index. “A linear regression trendline uses the least squares method to plot a straight line through prices so as to minimize the distance between the prices and the resulting trendline.“’ On the assumption that a trend in motion tends to continue in motion, technical analysis can use linear regression to predict future prices from past prices. However, as the chart below demonstrates, a linear regression line is only a parameter of a price series and can, in fact, fail to represent significant sections of that series.

One approach to trading using linear regression is the Linear Regression Channel developed bp Gilbert Raff. The Raff Channel “is constructed by plotting two parallel, equidistant lines above and below a Linear Regression trendline. The distance between the channel lines and the regression line is the greatest distance that any one closing price is from the regression line.” ’ In Raff s system, as the technician looks forward, the lower channel line provides support and the upper channel line constitutes resistance. When price reaches the lower band, it is a buy and when price reaches the upper band, it is a sell. Raff assumes that if price penetrates a channel line for more than a short time, a reversal may be in progress.

It should be apparent that Raff s approach to linear regression provides nothing more than a way for the investor to organize his guesswork. How does one know what action to take when price touches the upper or lower channel line? Will prices be contained at the band limit, or will they violate that limit and begin a reversal of the trend? Furthermore, how does an investor decide what constitutes a short term penetration of the channel line, indicating the trend is intact, or a long term penetration, indicating a major reversal is underway? Waiting to resolve this uncertainty may prove costly to an investor, but so might not waiting. It is simply impossible to devise clear and effective trading rules based on Raff s concept of the Linear Regression Channel.

John Bollinger’s general caution about trading bands makes plain the problem with using Raffs Linear Regression Channel idea as an independent trading tool: “Trading bands are one of the most powerful concepts available to the technically based investor, but they do not, as is commonly believed, give absolute buy and sell signals based on price touching the bands. Mhat they do is answer the perennial question of whether prices are high or low on a relative basis. Armed with this information, an intelligent investor can make buy and sell decisions by using indicators to confirm price action.” s

Another approach to linear regression is that developed by Robert Colby and Thomas Myers in their monumental The Encyclopedia of Technical Market Indicators. The authors tested Linear Regression Lines over two 9.75year test-periods of weekly data for the h%E Composite Index. (The first period ran from January 51968 through September 30,1977 and the second period ran from April 8, 19’77 through December 31,1986.) Their-work confirmed the obvious inference: that buying and selling when price crosses the Linear Regression Line is not an effective strateg): Since the Linear Regression Line runs through the middle of a price series, such a strategy precludes buying and selling at price extremes or even at relatively advantageous prices.J

Having rejected as ineffecti\-e the strategy of buying and selling when price crosses the Linear Regression Line, Colby and Myers adopted the alternative strategy of using the direction of the Linear Regression Line (rising is bullish, falling is bearish). The only variable they optimized was 11, the number of time periods (weeks) that went into their calculations. Testing Linear Regression Lines from 50 to 80 weeks, the authors found that the 66week line gave the best result when applied to the NYSE composite over the 19-year period studied. Total profit of 127.39 hYSE points was well above the “40/ewebweek simple moving average crossover rule standard of comparison” they used for all of their indicator studies throughout the Encyclopedia. There were 57 trades of which 25, or 44%, were profitable.”

While Colby and Myers regard their linear regression strateg as relatively successful, it appears that their approach, like Raffs, has its deficiencies. The problem is that by the time something as ponderous as a 66week Linear Regression Line changes direction, profits will be either seriously eroded or lost, since the trading signal will be late. In effect, the same objection that Colby and Myers found to buy ing and sellingwhen price crosses the Linear Regression Line holds for their strategy of acting on gross shifts in the direction of the line. See Charts 3 and 4 below.

One might, of course, depending on the individual equitv or index being traded, employ several different Linear Regression Lines, some perhaps significantly shorter than 66 weeks. But then one would be called upon to determine which Linear Regression Line to act on. Sor would such a maneuver be sufficient to rec the basic flaw in the linear regression strategy advocated b! Colby and Myers, as the legend beneath Chart 5 makes clear.

The essential problem with the trading rule employed by Colby and Myers is that it takes account only of whether the Linear Regression Line has turned up or down, ignoring the more critical matter of changes in the acuteness of the angle ofascent or descent. Ifthe regression line of prices is rising at a 50 degree angle, a decline in the angle of ascent to 40 or 30 degrees signals a significant waning of momentum and should be acted on. The investor who waits for the angle to turn negative (the line to mm down) would be late and would sacrifice too man! points.

It is necessary to acknowledge that part of the difficulty with the efforts of both Raff and Colby and Myers is inherent in the Linear Regression Line itself. The problem is that linear regression, at least as heretofore conceived, has no way of signalingwhat to the technician is the mostvital information: a change in both the direction and momentum of that trend. More specifically the deficiency of linear regression is that, unlike MACD or Stochastics, it does not provide a signal line, the crossing of which indicates a violation of the established trend, that is, a breakdown or breakout. It is this particular deficienq that I have attempted to remedy in this paper.

GLRA Hypothesis

Because the Linear Regression Line itself provides the technician with little help in making timely and reliable buy and sell decisions, the focus of my thinking shifted from the Linear Regression Line and the price series through which it is drawn to the Linear Regression Angle and a moving average of prices. I theorized that, ifan investor could not afford to wait for gross shifts in the direction 6f the Linear Regression Line, perhaps a more effective signal could be generated by taking account of incremental changes in the angle of the Linear Regression Slope. And indeed, this shift in focus led to the central hypothesis of this paper that a new technical indicator could be constructed incorporating a moving average of the Linear Regression Angles of a moving average of prices. Investigations conducted with this hypothesis in mind and utilizing the programming capabilities of Omega Research’s Super Charts 2.1 led to the development of what, I believe, is a new and valuable addition to the arsenal of technical analysis: the Gabriel Linear Regression Angle Indicator (GLRA).

Theory

The theory on which the GLRA is based has its roots in calculus. Technical Analysis utilizes moving averages which are afwzction of price and time. T@ical applications include using the moving average as support and resistance or comparing the current price to the moling average or examining moving average crossovers as harbingers offuture price action. However, one extremely,important characteristic of a moving average, often overlooked, 1s its slope or angle of ascent or descent. The slope of a line measures the inclination of the line relatiye to the positive x-axis. It is equal to the change along the vertical axis di\-ided bp the change along the horizontal axis. Slope can be positive, negative, or 0. It should be stressed that having a slope of 0 and having no slope are not the same. Horizontal lines have a slope 0, while vertical lines have no slope (undefined).

But a moving average is not a straight line; it is a curve. In order to determine the slope of a moling average one could consider utilizing one of the cornerstones of calculus and one of the major tools in analyzing functions: the 1st derivative. The derivative is the value of the slope of a tangent line to a curve at any given point. This assumes that the curve can be represented b?a differentiable function, in otherwords, that the slope of the tangent lme at any point will exist.

If we could calculate the slope of the tangent line to the moling average (see Fig. 1) at, for example, point (xc), yO) and then at point (x,, y,) important information about whether momentum is increasing or decreasing could be determined. In theory the peaks and troughs of the slopes of the tangent lines to the moving average should warn of an impending change in trend in as much as the? occur by definition early. That is, the rateof ascent or descent of prices must first peak and then go to zero for prices themselves to top or bottom.

However, the problem is that one cannot calculate the slope of a tangent to a mo\ing ayerage because the equation of the moving average is indeterminable. Therefore, we must fall back on linear regression to create lines which simulate the tangent lines along the moving average curve. The slopes of these regression lines can then be determined and their changing Linear Regression Angles can be analyzed to provide a leading signal as to whether internal momentum is accelerating or decelerating.

The relationship of the tangent lines to the curve is critical. N%en a curve lies above its tangents, it is oriented like a bowl with its opening facing up and is said to be concave up. Converse&when a curve lies below its tangents, it is oriented like an overturned bowl with its opening facing down, and is said to be concave dorm (see Fig. 2).


.A curve will have an inflection point ifit changes from concave up to concave down or vice versa. It is necessa? to note, however, that, instead of changing direction, it could simply resume the prevailing trend. One of the virtues of the GLIU, as we will see, is that it tends to correct itself quickly with minimal losses in such situations (see Fig. 4).


As indicated in Figure 4, Case 1, as the price pattern approaches the top at point& the slope decreases (lower chart), until at point& the price top, the slope is zero (flat), and the price is about to turn down. The slope now increases negativel); as price falls, and reaches its greatest downward rate at point X,. Note at point X,, that the slope bottoms and turns up as the downward rate of price decline eases @unto the price bottom at point XL. It should be clear now that the slope changes direction prior to prices doing so. Figure 4, Case 2, simply presents the opposite pattern for the behavior of the slope (tangent line angles) and prices.

GLRA Construction

The specific problem I addressed then, was how to transform a fimction or tool into an indicator, that is, into an instrument of technical analysis capable of signaling, objecti\-ely and reliably, changes in both the direction and momentum of the trend. The underlying assumption of this endeavor was that, though an individual Linear Regression Angle does not itself constitute an indicator, it does provide useful information which can be used to create one. The first step was to base the indicator on a simple moving average of prices in order to avoid the volatility of the raw price series. The next step was to use the regression beta, or slope, of the moving average and convert it to an angle. I derived the angle from a regression line using the last 3 points of the mo\-ing average. Finally, I smoothed these angles with a weighted moving average to constitute a fast line, and then created a second weighted moving average from the first weighted moving average to constitute a slow, or signal, line. b\‘eighted moving averages speed up the signals.

GLRA Plots

In the GLIB, 3 oscillators are generated (see appendix) which move above and below zero:

1. Plot 1: the angles of progressire regression lines calculated over 3 points along the lo-week simple moving average of closing prices (see Fig. 5). Note, Plot 1 will be concealed in the graphic representation of the GLRA Indicator.

2. Plot 2: the fast line, a S-week weighted moving average of Plot 1 (see Fig. 6).

3. Plot 3: the slow, or signal, line, a 14week weighted moving average of the Plot 2 (see Fig. 6).

Penetration of the slow or signal line by the fast line (the more important indicator) signifies a steepening or flattening of the linear regression series angle, that is, an acceleration or deceleration of momentum. Thus, when the fast line moves up through the signal line, generating a buy signal, negative momentum is decreasing or positive momentum is increasing; when the fast line moves down through the signal line, thus generating a sell signal, positive momentum is decreasing or negative momentum is increasing. Penetration of the zero line by the fast line signifies a shift in the linear regression series angle from positive to negative or negative to positive; that is, it signals a major change in the direction of the trend. Thus, when the fast line moves from above to below the zero line, the trend has turned down (the linear regression series angle has pivoted from positive to negative). When the fast line moves from below the zero line to above the zero line, the trend has turned up (the linear regression series angle has pivoted from negative to positive).

Initial testing has determined that a lo-week simple moving average, a 3week regression line, a Y-week (fast) weighted moving average, and a 14week (slow) weighted moving average appear to work best. Obviously, constructing the indicator using daily or monthly data would require an adjustment in the numerical parameters. Experience so far indicates that the GLRA is a powerful intermediate-term trading tool when using weekly data and in trending markets. As the following charts and performance summaries demonstrate, the GLRA Indicator successfully signals both tops and bottoms, but appears to be more consistently effective for long trades rather than short trades probably because, as Colby & Meyers argue, the market has had a strongly bullish secular bias.6 Mhile the GLRA Indicator cannot entirely escape the conditions of its rationale, it is an attempt to overcome the weakness inherent in all trend-following indicators by using small shifts in the Linear Regression Angle to signal major change in the price trend. I have included the calculation of the reward/risk ratio (total net profit/ maximum intraday drawdown) for each of the following securities. The GLRA compares favorably against the maximum cumulated drawdown figure of 6.13 cited by Colby and Meyers for their 40 week simple moving average crossover strategy’

Summary

The Linear Regression Line and the Linear Regression Channel, the only linear regression tools heretofore available to the technician, appear to be unreliable and ineffective instruments for market timing and intermediate-term trading. It is not, however, that linear regression is without value to the technician. Rather, technical analysis must go further to exploit the possibilities for indicator formation inherent in linear regression.

The Gabriel Linear Regression Indicator (GLRA) is new technical analysis tool which uses the important information provided by linear regression to overcome the weaknesses of linear regression as commonly employed. The foundation of the GLRA Indicator is a fundamental shift of focus to the linear regression angle of a moving average of prices. In its final form, the GLRA indicator uses two weighted moving averages, a fast line and a signal line of the linear regression angles of a simple moving average of prices.

The GLRA Indicator is an attempt to overcome the weakness associated with trend following systems by using small shifts in the Linear Regression Angle of a moving average of prices to signal a change in trend prior to the actual breakdown or breakout in prices.

Testing of the GLRA indicator confirmed its value both for market timing and intermediate-term trading of financial instruments. Experience indicates that when the GLRA gives a false signal, it tends to correct itself with minimal losses.

Appendix

Indicator Calculation

SuperCharts 2.1 indicator library includes several tools that can be applied to determine the slope of a curve. Linear Regression Slope (LinearRegSlope) returns the slope (0 = neutral, positive number = upslope, negative number = downslope) of the linear regression line for the period ofx bars counting back from the current bar. Thus, the larger the absolute value, the steeper the slope of the linear regression line. Linear Regression Angle (LinearRegAngle) is similar to LinearRegSlope except that the slope of the line is converted to an angle and returned in terms of degrees.8

Plot 1 = LinearRegAngle(Average(Close,Length),Length2)

Returns the Linear Regression Angle for an n period simple moving average of closing prices (lengthl) back x number of points along that moving average length2). This plot is not depicted in the presentation of the indicator. Input Plot 1 Lengfhl default setting n = 10, Length2 (x) = 2

Plot 2 = IlYveragtfPlot I,Length?) a 1000

Returns the n periodweighted moving ayerage of Plot 1 multiplied by 1000 for presentation purposes. The angle of ascent cannot be greater than 90 degrees t90,OOO) and the angle of descent camrot be greater than minus 90 degrees (-90,000). Input Plot 2 Lenglh3default setting n = 9

Plot 3 = IWuerage(Plot 2,Length4)

Returns the n period weighted moving average of Plot 2. This creates a slow or signal line above and below which Plot 2 oscillates. Input Plot 3Length4default setting n = 14

Plot 4 = 0

Places a zero line on the chart.

Endnotes

  1. Steuen B. Achelis, Technical Analysis from A to Z (Chicago: Probus Publishing, 1995) p. 163.

  2. Ibid.

  3. John Bollingq “Bollinger Bands, ‘I Technical Analysis of Stocks& Commodities, Feb. 1992, p. 18.

  4. Robert \I! Colby and Thomas A. Myrs, The Encvclobedia of Technical Market Indicators (Homtwood, Illinois: Dow Jones-Irwin, 1988) p. 253.

  5. Ibid.

  6. Ibid., p. 28.

  7. Ibid., p. 42.

  8. Damian Teixeira, SuberCharts User’s Manual (Miami: Omega Research, Inc., 1993) pp. 379-380.

Bibliography

  1. Steven B. Achelis, Technical Analvsis from A to Z. Chicago: Probus Publishing, 1995.

  2. John Bollinger, “Bollinger Bands,” Technical Analvsis of Stocks & Commodities. February 1992: 18-25.

  3. Robert W. Colby and Thomas A. Myers. The Encvclonedia of Technical Market Indicators. Homewood, Illinois: Dow Jones Irwin, 1988.

  4. Peter Frank, David A. Sprecker, and Adil Yaqub, A Brief Course in Calculus with Annlications. NewYork: Harper and Row, 1971.

  5. Raymond McGivney, James Mckim, and Benedict Pollina,& sential Precalculus. Belmont, California: M’adsworth Publishing, 1980.

  6. John J. Murphy, Technical Analvsis of the Futures Markets: A Comnrehensive Guide to Trading Methods and AnDlications. New York: New York Institute of Finance, 1986.

  7. Steven Nison,Jananese Candlestick Charting Techniaues. New York: New York Institute of Finance, 1991.

  8. Martin J. Pring, Martin Print on Market Momentum. Gloucester, Virginia: International Institute for Economic Research, Inc., 1993.

  9. Damian Teixeira, SunerCharts User’s Manual. Miami: Omega Research, Inc., 1993.

Terence J. Gabriel

Terence J. Gabriel is a New York-based Technical Strategist with I.D.E.A., an international consulting company providing economic research, market commentary, and trading recommendations to major financial institutions throughout the world. At I.D.E.A., he is responsible for the technical analysis of equity indices, bonds, and commodities. He holds a BS in Finance from the University of Connecticut and an MBA from Syracuse University.

The Editor wishes to thank Professor Jack Healey, Golden Gate University, for his review of this article.

Comments

 

No comments have been made yet.