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]


20

11

minnnmiinitmiimunmmuim mmnmiimmniimnmimiinm

tnnnimminmnmmmmnum



where is the size, or width, of the window. The weighting factors Wi will increase linearly from 1 to the middle of the window, at n/2, then decrease to the end at n This has a slighdy different form when the period is odd or even,

Wt = i, for 1 - 1 to @irtportionl(r+Z)/2)

n-i + 1, for i = @intportiomir+2)/2) + 1 to n (even values of >

n-i. for i - @intportionl{r+2)/Z) + 1 to n (odd values of w)

where, for odd values of n, the weight factor has the value i when i ranges from 1 to « 2 (rounded up using the function for the integer portion) and the value of #? - i from n.l to «. Instead of a triangular filter, which is very precise about the middle value having the greatest imptxtance, we may choose a Gaussian filter, which weights the data in a form simUar to a bell curve. Here, the weighting factors are more complex.

= 10- and >: = f(l-)

Pivot-Point Weighting

Too often we limit ourselves by our training. When a weighted moving average is used, it is normal to assume that all the weighting factors should be positive; however, that is not a requirement. The pivot-point moving average uses linear weights (e.g, 5, 4.... ) that begin with a positive value and continue to decline even when they become negative. This method treats the oldest data in a manner opposite to their direction. In the following formula, a pivot point, where the weighting is zero, is readied about 2/3 of the way through the data interval. For a pivot-point moving average of 11 values, the 8th data point is weighted with 0:

PPMA,(11) = UP, + , + 5P, + 4P, + + 2P, + IP, + OP, -\P,-2P,- iP,):22

This technique is intended to limit the lag by front loading the prices and reducing the divisor of the weighting formula by the sum of the negative weighting factors. The general formula for an n-day pivot-point moving average W

To implement this in a computer program, the following steps would be used:

a S»jm = ;

-Foi- I = T to M t.ergn

3 m = IM-n-t-l;

4 sum - sum-!- PCr-lD*(3*l - IM - ; er>cl ;

6 P PMA - s um* 2 / (N* (rsHT>3>

where lines 2 through 5 calculate the sum of the prices times the weighting factor, and line 6 divides that sum by the sum of the weighting factors (after multipljing the top and bottom of the fraction by the value 2).

The negative weighting factors reverse the impad of the price move for the oldest data points rather than jusl give them less importance. For a short interval this can cause the frendline to be out-of-phase with prices. The application of this method should be limited to longer-term cyclic markets, where the refledion point, at which the weighting fedor becomes zero, aligns with the cyclic rum or can be fixed at the point of the last frend change.

TalrickE L.rf[eir7."End-P.iiitM"Vii,EAvera ." TecAaiical AualysiE l£tock.-& Oiumodities (Octot. 1 DonrJ-i-b Letto-E To S&C" ! Analysis-iLtccVs & r.jumodities fFebmarr 1996. p 1j.



GEOMETRIC MOVING AA-ERAGES

The geometric mean is a growth function that is very applicable to long-term price movement, introduced in Chapter 2 ("Basic Concepts"). It is especially useful calculating the components of an index. The geometric mean can also be applied to the most recent n points at time t to get a geometric average similar to a moving average

The daily calculation is more complicated but, as shown in Chapter 2, could be rewritten as in In If H----H- in I*t * \

Jn CP, =

This is similar in form to the summation of a standard moving average based on the arithmetic mean and can be written for either spreadsheet or program code as

GA = @average(@log(price),n)

Note that some software will use -log" although the calculation is actually the natural log. In. Other programs will allow the choice of @1 og ( va 1 ue) or ; 1 n va 1 ue). A weighted geometric moving average would have the form

The geometric moving average itself would give greater weight to smaller values without the need for a discrete weighting function. In appljing the technique to actual commodity prices, this distinction may not be obvious. For widely ranging values such as 1,000 and 10, the simple average is 505 and the geometric average is 100, but for the three sequential cocoa prices, 56.20, 58.30, and 57.15, the arithmetic mean is 57.2166 and the geometric is 57.1871. A similar test of 5, 10, or 20 dajs of commodity prices win show a negligible difference between the results of the two averages. If the geometric moving average is to be helpful, it would be best applied to long-term historic data with wide variance, using yearly or quarterly average prices.

DROP-OFF EFFECT

Two tjpes of trending methods can be distinguished by the drop-off effect, a common way of expressing the abrupt change in value when a fixed-period calculation drops off a significant value. A simple moving average, linear regression, and weighted averages all use a fixed period, or window, for determining the trend. When an unusually volatile piece of data becomes old and drops off, ttiere can be a sudden jump in the ttend value, called the drop-off effect. For an n-period moving average, this value is the difference between the first and the last iterns, divided by the number of periods,

drop-off effect - Uf, - Pt- /n



[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]