016MOV (1)

download 016MOV (1)

of 6

Transcript of 016MOV (1)

  • 8/12/2019 016MOV (1)

    1/6

    Stocks & Commodities V17:2 (101-106): Moving Averages, First Principles by Brian J. Millard

    Copyright (c) Technical Analysis Inc.

    BASIC TECHNIQUES

    Moving Averages,First Principles

    O

    Dont quite understand moving averages, but think that you

    could benefit from using them? Heres how to understand

    and apply moving averages to identifying trends in stocks.

    By Brian J. Millard

    f all the technical indicators,

    moving averages are perhaps

    the most widely used andmis-

    understood. Incorrectly applied,

    as is usually the case, they may

    be responsible for more losses

    than any other indicator. Cor-

    rectly applied, however, they

    can be the most versatile and

    powerful tools available. The

    reasons for failure? First, a poor

    understanding of how stock

    prices move, and second, a poor understanding of the

    properties of moving averages.

    It is important to note that if the user does not attempt to

    understand how prices move, then applying any indicator is

    a haphazard affair. Indicators tend to be developed by trialand error, and without a clear understanding of how they

    work, using them can lead to disappointing and disastrous

    results.

    STOCKPRICEMOVEMENTThe point-to-point movement modelis based partly on the

    one put forward by analyst J.M. Hurst a number of years ago

    and partly on my own research. In this model, stock move-

    ment is considered to be composed of random point-to-point

    movement and complex cyclic movement. Point-to-point

    movementis simply a generalization of the sampling interval

    and refers to the change between one data point and the next,

    such as tick-to-tick, day-to-day, and week-to-week, aswell as others.

    POINT-TO-POINTMOVEMENTPoint-to-point movement is easily extracted from stock data

    by most technical analysis programs. An indicator is usu-

    ally available that will give the difference between succes-

    sive points; if not, such an indicator can often be created

    within the program. As an alternative, stock price data can

    be imported into a spreadsheet and the successive differ-

    ences calculated and plotted. This method is useful, since a

    spreadsheet function will be available to determine the

    standard deviation of these differences, a valuable quantity

    that will be discussed later.

    The point-to-point differences can have negative, positive,

    or zero (no change from the previous point) values. A plot of

    these daily differences over a short period can be seen in

    Figure 1. The vertical grids are spaced at 10-day intervals,

    and the vertical scale is in dollars. A sequence of changes in

    the same direction is indicated by the plot remaining on the

    same side of the zero line.

    A close inspection of the differences reveals that the

    longest such sequence occurred between June 18 and July 2,

    1998, and extended to eight successive rises. The extreme

    peaks and troughs have no meaning other than they are the

    maximum changes recorded. In general, a sequence of more

    than 10 successive moves in the same direction in a stock

    almost never occurs.

    During this period of 191 trading days, there were 99 rises,

    87 falls, and four no change. There was a slightly higher

    probability (52%) of a rise than there was a fall. There were

    102 occasions when the change was in the same direction as

    the previous change and 87 occasions when it was not. There

    was a slightly higher probability (54%) of a change occurring

    in the same direction as the previous change.The preponderance of probabilities one way or the other

    is one of the factors that produces the overall trend in the

    stock price over a period. Usually, these probabilities are so

    close to 50% as to offer no advantage in predicting the

    direction of the price movement.

    A more thorough study of these point-to-point move-

    ments, however, uncovers the fact that the occurrence of

    various movements in the same direction is slightly higher

    than called for on a purely random basis, but this is of no help

    when it comes to predicting the next move. As far as the

    model is concerned, we can consider point-to-point move-

    ment to be purely random.

    CYCLICMOVEMENTBesides point-to-point movement, the other component of

    price movement is composed of cycles of differing wave-

    length, magnitude, and phase. The wavelengthis the distance

    between successive peaks or troughs, and the magnitudeis

    the vertical distance between a peak and the next trough or a

    trough and the next peak. The phase is the relationship

    between a peak and a given starting point. It is instructive to

    examine just one such cycle say, the nominal 41-week

    cycle in IBMstock especially for investors who do not

    subscribe to cycle theory.

  • 8/12/2019 016MOV (1)

    2/6

    Stocks & Commodities V17:2 (101-106): Moving Averages, First Principles by Brian J. Millard

    Copyright (c) Technical Analysis Inc.

    CHRISTINE

    MORRISON 7

    65

    4

    32

    10

    -1-2

    -3

    -4-5

    -6

    -7-8

    -9

    5/21/98

    6/4/98

    6/18/98

    7/2/98

    7/16/98

    7/30/98

    8/13/98

    8/27/98

    9/10/98

    IBM (Daily differences)The nominal 41-week cycle is isolated from the weekly

    closing prices in IBM, as can be seen in Figure 2 by a

    method involving two moving averages. The point in

    Figure 2 is that the distance between peaks and troughs

    varies as we move across the plot; that is, the wavelengthis constantly changing.

    Because of this, the expression nominal wavelengthis used

    when referring to a particular cycle in market data, meaning

    the average wavelength of an individual cycle over a period.

    The other changing parameter is the magnitude the verti-

    cal distance from a trough to the next peak or from a peak to

    the next trough.

    The phase of the cycle might also be changing, but the

    effect of change in phase is to give the appearance of a change

    in wavelength.In this way, phase change and wavelength

    change can be lumped together as wavelength change. TheFIGURE 1: DAILY DIFFERENCES. The differences between one days closingprice and the next is plotted for IBM stock over a four-month period.

  • 8/12/2019 016MOV (1)

    3/6

    Stocks & Commodities V17:2 (101-106): Moving Averages, First Principles by Brian J. Millard

    Copyright (c) Technical Analysis Inc.

    variation in wavelength is less severe than in magnitude, and

    thus, the next turning point in a cycle is predictable within

    fairly narrow limits.

    Much wider limits must be applied to a prediction of

    magnitude. In general, cycles pass though periods when their

    behavior is reasonably predictable and other periods when

    they are less so.Many cycles are present in the movement of an individual

    stock, some of which may be universal to all stocks and others

    unique to that one. The fact that some cycles are universal to

    all stocks (for example, a nominal 41-week cycle can be

    shown to be present in all the S&P 500 stocks by using the

    moving average method used for IBMin Figure 2) does not

    necessarily mean that they will pass through peaks and

    troughs at the same time. They do occasionally, and it is at this

    point that extreme rises and falls in the market occur.

    It is debatable whether the market influence causes cycles to

    come into phase with each other. Each of these cycles will go

    through this variation in wavelength and magnitude, but the

    variation among a group of cycles of contiguous wavelengths,covering a large band of wavelengths, can often cancel each

    other out. As a result, the behavior of such a group is much

    more predictable than the behavior of an individual cycle.

    Now that we have a model of stock price movement,

    we can investigate the properties of moving averages and

    how these properties may be of use in the interpretation

    of such movement.

    PROPERTIESOFMOVINGAVERAGESWhile it might seem trivial, it is important to understand the

    procedure by which a simple average is calculated, since

    then it is possible to understand the main property of an

    average. An average is derived from a running total

    calculated, for example, for an n-point average by adding

    up the first ndata points. The running total for the next

    calculation is modified by adding the next data point and

    dropping the first. Thus, the procedure is to constantly

    modify the running total by adding in the (n+ 1)thpoint (the

    new point) and dropping the first point (the drop point) of

    the total. As each running total is calculated, the corre-

    sponding average is obtained by dividing it by n.

    For a regular cycle one with constant wavelength, mag-

    nitude and phase, and symmetrical around a zero line we will

    find that if an average of span nis applied to such a cycle with

    wavelength also equal to n, the first value of the running totalwill be zero. This is because there will be a corresponding point

    below the zero line for every point in the wave above the zero

    line. For the next value of the running total, we find that the

    point we must add in has exactly the same value as the point we

    must drop. Hence, the total will remain at zero and continue to

    do so as we move along the wave.

    This will also happen when the span is an exact multiple of

    the wavelength. Clearly, the net result is that such cycles will

    be completely absent in the resulting averaged data (the out-

    put). What happens if the span of the average is not the same

    as the wavelength? In such cases, the magnitude of cycle will

    be reduced in the averaged data, and in some instances will be

    displaced in position. The various possibilities are best ad-

    dressed by looking at various values of min the relationship:

    8

    7

    6

    5

    4

    3

    2

    1

    0-1

    -2

    -3

    -4

    -5

    -6

    -7

    IBM (41-week cycle)

    2/11/94

    7/1/94

    11/18/94

    4/7/95

    8/25/95

    1/12/96

    5/31/96

    10/18/96

    7/25/97

    12/12/97

    5/1/98

    9/18/98

    2/5/99

    3/7/97

    FIGURE 2:NOMINAL 41-WEEK CYCLES.The nominal 41-week cycle is plotted forIBM since early 1994. Note the moderate variation in wavelength as measured bythe horizontal successive peak-to-peak and trough-to-trough instances. The varia-tion in magnitude as measured by the vertical successive trough-to -peak and peak-to-trough distances is much more pronounced.

    The running total is constructedby adding in the new point andsubtracting the drop point. Thetotal is then divided by n, the span.

    When mis an exact integer, the cycle will be completely

    removed from the output. When mis less than 1, the magni-

    tude of the cycle will be reduced in the output. The phase of

    the output (positions of peaks and troughs) will be identical

    to that of the original cycle. As mdecreases, the amount of

    reduction decreases.

    Span = mw

    Where m= a numeric value

    w= wavelength

    Where mlies between an even value of mand the next odd

    value of m, the output will remain in phase with the original.

    The magnitude will be reduced, the amount of reduction

    falling to a minimum and then rising as mmoves between the

    two extremes.Where mlies between an odd value of mand the next even

    value of m, the phase of the output will be shifted by half a

    wavelength from the original. The magnitude will be re-

    duced, the amount of reduction falling to a minimum and then

    rising again as mmoves between the two extremes.

    CHANGEINVALUEThe running total is constructed by adding in the new point

    and subtracting the drop point. The total is then divided by n,

    the span. Thus, the change in the average from its previous

    calculated value depends on the difference between the new

  • 8/12/2019 016MOV (1)

    4/6

    Stocks & Commodities V17:2 (101-106): Moving Averages, First Principles by Brian J. Millard

    Copyright (c) Technical Analysis Inc.

    point and the drop point and also on the value of the span of

    the average. For any given difference between the new point

    and the drop point, the change in the average will obviously

    decrease as we increase the span, because we are dividing the

    total by increasingly larger numbers.

    On the other hand, for any given span, the change in the

    average will increase as the difference between the drop point

    and the new point increases. In real terms, a kink will appear in

    the averaged data not only if there is aspike,a large change in the

    data at the position of the new point, but also if there is a spike

    in the historical data at the position of the drop point. If there isa spike in both positions, the average will be doubly affected if

    these spikes are in opposite directions. If they are in the same

    direction, the kink will be greatly reduced or even absent.

    11

    10

    9

    8

    7

    6

    5

    4

    3

    2

    1

    0

    -1

    FIGURE 3: APPLICATION OF AVERAGES TO CYCLIC DATA.The solid sine waveis a regular cycle of wavelength of 51 weeks. The solid horizontal line at the $5 levelis the output from a 51-week average. The dashed waveform with peaks andtroughs aligned with the original sine wave is the output from the 31-week average.The dashed waveform with peaks and troughs out of phase with the original sine

    wave is the output from a 75-week average.

    70686664626058565452

    5048464442403836343230

    AT&T (daily)

    12/8/94

    4/27/95

    9/14/95

    2/1/96

    6/20/96

    11/7/96

    3/27/97

    8/14/97

    5/21/98

    10/8/98

    2/25/99

    1/1/98

    706866646260585654525048464442403836343230

    AT&T (daily)

    12/8/94

    4/27/95

    9/14/95

    2/1/96

    6/20/96

    11/7/96

    3/27/97

    8/14/97

    5/21/98

    10/8/98

    2/25/99

    1/1/98

    706866646260585654525048464442403836343230

    AT&T (daily)

    12/8/94

    4/27/95

    9/14/95

    2/1/96

    6/20/96

    11/7/96

    3/27/97

    8/14/97

    5/21/98

    10/8/98

    2/25/99

    1/1/98

    FIGURE 4: NONLAGGED AVERAGES.The smooth line is the output from a 201-dayaverage plotted with no lag. The relationship between the data and the average isnot obvious.

    FIGURE 5: CENTERED AVERAGES.The smooth line is the output from a 201-dayaverage plotted as a centered average, lagging by 100 days. The average can beseen as a representation of the longer-term trend.

    FIGURE 6: ERROR IN NONLAGGED AVERAGES.Both the unlagged and centeredaverages are plotted on the same chart. The first two double-headed arrows showwhere the direction of the unlagged average is opposite to the true direction of thetrend. These are the places where methods based on unlagged averages are likelyto be in error. The third arrow in mid-1998 indicates a period when the direction ofthe trend is yet to be established.

    APPLICATIONOFANAVERAGE

    Point-to-point movement:Simply, the isolated point-to-point

    movement can be considered to be truly random. In such a case,

    the difference between two points is independent of their

    distance apart in time and is simply a random value. Thus, the

    difference between a drop point and the new point is chance.

    The only factor with an effect in reducing movement in the

    averaged data is the span used for the average; the greater the

    span, the greater the reduction. The movement will never be

    quite eliminated, but it will become unimportant once wereach spans of 50 or greater. On those occasions where the

    drop point is an extreme one, and the new point is also

    extreme but in the opposite manner, then there will still be a

  • 8/12/2019 016MOV (1)

    5/6

    Stocks & Commodities V17:2 (101-106): Moving Averages, First Principles by Brian J. Millard

    Copyright (c) Technical Analysis Inc.

    kink in the resulting average, taking even larger spans to

    reduce to an unimportant level.

    If the random point-to-point movement is not isolated but

    present in addition to the mixture of cycles, as is the case with

    real stock market data, then we do not need such large spans

    for the average to appear to eliminate this movement. It will

    only represent a proportion of the total movement, and theaveraged data will have larger positive values due to the

    cyclic data present, making the averaged random movement

    appear insignificant.

    The smaller the proportion of random movement in the

    total data, the smaller the span required to reduce it to

    apparent insignificance; extreme values of the drop point and

    the new point will still leave a kink in the averaged data. Nine

    points or less will usually suffice to smooth out the point-to-

    point movement. We can use the value of standard deviation

    mentioned previously to give us an idea of the proportion of

    stock price movement due to randomness.

    Statistically, 95.5% of the random movement will be

    contained within two standard deviations either side ofthe mean, so four times the standard deviation is due to

    this random movement. Dividing this by the lates t stock

    price gives us an estimate of the proportion of random

    point-to-point movement in that stock. For IBM, this

    amounted to about 7.7% in October 1998. This does not

    include the random variation in the magnitude of the

    cycles present.

    Cyclic movement in stocks:As we have seen for IBM, cycles

    in real stock market data are not regular, since they change

    randomly in wavelength and magnitude. The property of an

    average that removes a cycle of the same wavelength or

    multiple thereof will not apply. However, the property of

    reducing the contribution of cycles of wavelengths greater or

    lesser than the span will still apply, and this is what makes

    moving averages so valuable.

    Once we move above spans of about 9 points, there will be

    a marked reduction of the point-to-point movement and of

    those cycles whose wavelength is less than the span of the

    average. Wavelengths longer than the span of the average are

    most relevant. Roughly, cycles with wavelengths about 1.5

    times the span of the average will be reduced by about 70%,

    while those with twice the span will be reduced by about 50%,

    but those four times the span will be reduced by only 10%.

    The main effect of applying an average to stock marketdata is to remove random point-to-point movement and

    reduce cycles whose wavelengths are less than about twice

    that of the span of the average. All this works to leave us with

    a fairly smooth average whose shape is mainly due to the

    combination of all those wavelength cycles greater than

    about twice the span of the average.

    CENTEREDAVERAGESOne of the major reasons that moving average methods fail is

    that the averages are usually plotted with no lag; that is, they

    are not centered. The use of unlagged averages is so ingrained

    in chartist techniques that it is no longer possible to eradicate

    it. However, the properties of moving averages we have

    discussed assume that averages are presented as centered.

    We can demonstrate the advantages of centered averages

    over unlagged averages by referring to two charts. The plot

    of a 201-day average in the usual chartist mode can be seen

    in Figure 4, while in Figure 5 the average is plotted as acentered average. A centered average of span nis set back in

    time by:

    (n- 1)/2 points

    We use 201 rather than 200 days to give a lag that is an integer

    (100, in this case), allowing us to center the average at the

    position of a data point and not between two such points.

    Plotting averages as in Figure 4 is only useful if the

    crossing of the average by the data, or the crossing of two

    averages, has some meaning. Plotting them as centered

    averages as in Figure 5 has two main advantages. First, the

    average is a better representation of the data, since short-termfluctuations and random day-to-day movement have been

    almost totally removed. What is left is the net effect of all

    those cycles of wavelength greater than about 400 days.

    Thus, a centered average is representative of a trend, which

    can be considered to be the long-term trend.

    A nonlagged average, on the other hand, is in the wrong

    position to be considered to be a trend, even though its shape

    is identical to that of the centered average. The second and

    perhaps the most vital point concerns the lag in the average,

    which in this case is 100 days. We do not know how this

    average moved during this period, and because we now

    consider the centered average as representing the trend, we do

    not know what the trend has been doing. This is something

    that we will discover only when we make new calculations

    over the next 100 days into the future.

    This point is the source of disappointment when nonlagged

    averages are used as a guide for trading decisions. The actual

    trend could well have changed direction during this period, so

    decisions that assume that the trend is still rising because the

    average was still rising at the last calculation can go disas-

    trously wrong.

    This point can be illustrated by plotting both the nonlagged

    and centered averages on the same chart, as seen in Figure

    6. There are two places where the trend, as indicated by the

    centered average, is going in the direction opposite to thatof the nonlagged average. These are marked by the first two

    double-headed arrows.

    The third, latest, arrow is at a point where we do not know

    what the current trend is doing, so the trend might be going

    in the direction opposite to that indicated by the nonlagged

    average. It is at these turning points that decisions based on

    nonlagged averages will come to grief.

    Because the centered average is lagging by half of a

    span 100 days we have two places in the plot where

    the nonlagged average is in error for 100 days a total of

    200 days out of 860, covering the period of the plot up to

  • 8/12/2019 016MOV (1)

    6/6

    Stocks & Commodities V17:2 (101-106): Moving Averages, First Principles by Brian J. Millard

    Copyright (c) Technical Analysis Inc.

    the last position of the centered average. In addition, we

    have a third place where the unlagged average will be in

    error if the trend changed direction in mid-1998, although

    this has yet to be established. Thus, for at least 25% of the

    time, the nonlagged average indicates an incorrect direc-

    tion for the long-term trend.

    In those stocks with more frequent turning points, theposition will be even worse. This is unfortunate, because just

    when the investor is most in need of help in deciding whether

    a trend has changed direction is the time when the nonlagged

    average is giving the wrong answer. However, there are ways

    in which an estimation of the trend direction and whether it

    has changed can be improved, and these will be discussed in

    another article.

    FURTHERAPPLICATIONSAnother point should be noted when a centered average is

    plotted. From Figure 5, it can be seen that the excursions

    of the data on either side of the average line are limited.

    When a maximum distance is reached, the data reversesdirection. Boundaries can be drawn to contain this move-

    ment, leading to the powerful predictive technique known S&CSee Traders Glossary for definition

    as channel analysis.

    My next article will show how the short-term fluctuations

    that still appear in the output of simple averages can be

    removed by applying a second average or a weighted aver-

    age. I will also look at the use of the difference between two

    averages and the difference between the average and the data

    for investigating individual cycles and groups of cycles.

    Brian Millard is the author of six books on technical analysis,

    includingProfitable Charting Techniques,Channel Analysis

    andChannels And Cycles.

    RELATEDREADINGHurst, J.M. [1970]. Profit Magic of Stock Transaction Tim-

    ing, Prentice-Hall.

    Millard, Brian J. [1997]. Channel Analysis, second edition,

    John Wiley & Sons.

    _____ [1999]. Channels And Cycles: A Tribute To J.M.

    Hurst, Traders Press.

    _____ [1997]. Profitable Charting Techniques, second edi-tion, John Wiley & Sons.