back start next


[start] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [ 19 ] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] [98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122] [123] [124] [125] [126] [127] [128] [129] [130] [131] [132] [133] [134] [135] [136] [137] [138] [139] [140] [141] [142] [143] [144] [145] [146] [147] [148] [149] [150] [151] [152] [153] [154] [155] [156] [157] [158] [159] [160] [161] [162] [163] [164] [165] [166] [167] [168] [169] [170] [171] [172] [173] [174] [175] [176] [177] [178] [179] [180] [181] [182] [183] [184] [185] [186] [187] [188] [189] [190] [191] [192] [193] [194] [195] [196] [197] [198] [199] [200] [201] [202] [203] [204] [205]


19

An accumulative average may be used for a long-term trend, it does not satisfj our strict definition of a moving average, because it adds data but does not discard any; tlierefore, it is cumulative. It is traditionally started at the beginning of a futures contract and continued until the contract expires. It may be applied to stocks after each dividend notice. Due to the accumulation of prices and the constant increase in the length of the average, the effect of the additional price at day / on the moving average will be (Pt - AVG)/t, where

AVG is the average of all prices from the beginning through t. The impact of 1 day becomes very small toward the end of a I-year confrad, which has approximately 250 trading dajs. A reset accumulative average is a modification of the standard accumulative average and attempts to correct for the loss of sensitivity as the number of fradng days becomes large. This altemative allows you to reset or restart the moving average whenever a new frend begins, a significant event occurs, or at some specified time interval.

Truncated moving averages are the most common, and they are often called simple moving averages. The mosl basic has alreadj been discussed in detail- An altemate method of calculating a daily moving average calculation is to keep the total of the past n days. Each new day then only requires the addition of the new value and subtraction of the oldest one. The new total is saved for the neKt day and is also divided by n to get the new moving average value. An interesting twist to this technique is the averagemodifted method, in which the price of the new day is added and the last moving average value is subtracted. Returning to the of a 5-day moving average, day 6 was

= MA, -H C>6 - »i)/3 This becomes

IVLA.6 = MA -I- - MAO/5

The average-modified version is convenient, because only the prior moving average value and the new price are necessarj for each calculation. The substitution of the moving average value tends to smooth the results even more than a simple moving average. Its use prevenisihediference(P(-f Jtombecomingtoomeme;iitfiemiriycu[sihei»ssi- ble range in half and dampens the end-off impact.

The weighted moving average opens many possibilities. It allows the significance of individual or groups of data to be changed, it may restore proper value to parlif of a data sample, or it may incorrectly bias the data. A weighted moving average is expressed in its general form as

i = i

This gives the weighted moving average at time t as the average of the previous n prices, each with its own weighting factor w. The most popular form of this technique is called front loaded, because it gives more weight to the most recent data and reduces the significance of the older elements. Therefore, for the front-loaded weighted moving etsee Figure 4-1)

The weightmg factors wi may also be determmed by regression analjsis, but then they may not necessanly be front-loaded. A common modification to front loading is called step



weishtin in which each successive w, differs firom the previous weighting factor , by a fixed increment

C = tVi - Wi-,

The simplest case takes integer values for an «-day step-weighted moving average: M-, = Mz = - 1

This gives the weigliting fad;ors the values of 5,4, 3, 2, and 1 for a 5-day calculating a linearly weighted moving average is

FIGLIRE 4-1 A comparison of moving averages.

A computer program for

1 - 0;

I - 1 to N begin

M - N - 1 + 1 ;

In line 6, the divisor <:N*<:N-H))/2 Is the arithmetic formula for the sum of I t- 2 + - + TV Another approach would be a percentage relationship between , elements, ui , - X uj,

where a = -90; then, t*-, = 5, = 4.5, « -» = 4 05. tA-z = 3-645, and u, = 3-2805.

Prices may also be weighted in groups. If every two consecutive data elements have the same weighting factor.

jJi-z-HtP.-3H

or, grouped with r

Any number of consecutive data elements can be grouped for a step-weighted moving average. Because there can be any number of combinations, there is no simple, automatic method for calculating anjlhing other than a linearlj weighted average, which is the functiontaWAveragefprice, length) in Omegas Easj Language. If the pu ose of weighting is to duplicate a pattem that is intrinsic to price movement, then the following sections on geometric



averages and exponential smoothing may provide better tools.

These moving averages can also be plotted in different wajs, each way havmg a major impact on their interpretation. The conventional plot places the moving average value MA, on the same vertical line as the last entry P6 of the moving average. When prices have been trending higher over the period of calculation, this will cause the value S1& to lag behind (or below) the actual prices, when prices are declining, the moving average will be above the prices (see Figure 4-2).

The plotted moving average can either lead or lag the last price recorded, if it is to lead by 3 dajs, the value MA, is plotted on the vertical line t + 3; if it is to lag by 2 days, it is plotted at t - 2. In the case of leadng moving averages, the analjsis attempts to compensate for the time delay by judging price direction using a forecast based on current rate of change and direction. A penetration of the forecasted line by the price may be used to signal a change of direction. The lag technique may also serve the more sophisticated piupose of -ing the moving average. A 10-day moving average, when lagged by 5 dajs, will be plotted in the middle of the aaual price data. This technique will be covered later.

Comparison of Moving Average Methods

The comparison seen in Table 4-3 confirms that simple moving averages taken over shorter periods identify shortei trends. The 3-day moving average trendline had 9 separate trends, while the 10-day had only 5. The 5-day average modified method was very similar to the lOday simple moving average due to removing the average price each day. The cumulative average showed the fewest trends even though it began its accumulation process only 10 dajs prior; as time increases, this trend will become less responsive. For this short sample interval, the 10-day linearly weighted average was identical to the average modified method and very similar to the 10-day simple average; however, because it weights the recent data 10 times greater than the oldest, this similarity will not continue. A closer look will show that the trend values are very different

FIGURE 4.2 Plotting lag and lead fora 10-day step-weighted moving average with weighting factors of 10. 9. 8..

gssgSsiiisEgiiSigigiSBSSS

Triangular Weighting

While the simple moving average or linear regression treats each price equally, exponential smoothing and linear stqa weighting puts greater weight on the most recent data. There is an entire area of study in which the period of the dominant cycle is the basis for determining the best trend period. Triangular filtering is a related concept that attempts to uncover the trend by reducing the noise on both the front and rear of the frend window, where it is expected to have the greatest interference. Therefore, if a 20-day weighted average is used, the 10th day will have the greatest weight, while dajs 1 and 20 will have the smallest.

To implement friangular weighting, begin with the standard formula for a weighted average.



[start] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [ 19 ] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] [98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122] [123] [124] [125] [126] [127] [128] [129] [130] [131] [132] [133] [134] [135] [136] [137] [138] [139] [140] [141] [142] [143] [144] [145] [146] [147] [148] [149] [150] [151] [152] [153] [154] [155] [156] [157] [158] [159] [160] [161] [162] [163] [164] [165] [166] [167] [168] [169] [170] [171] [172] [173] [174] [175] [176] [177] [178] [179] [180] [181] [182] [183] [184] [185] [186] [187] [188] [189] [190] [191] [192] [193] [194] [195] [196] [197] [198] [199] [200] [201] [202] [203] [204] [205]