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]


127

IVIDVA : Vanacle Inaex Dyramic Average Dy Tusnar Chande Copyright 1997-1998, PJ Kaufman. All rights reserved. Period suggested at 9, histper suggested at > 91

input: period(9). histperOO);

var: kiO), sc(0), WIDVAfO);

Irelative volatility)

- @stddev(close, period) / @stodev(close,histper); I smoothing constarti

sc - / (period + 1);

IVIDVAI

VIDVA - k*sc*close + {] - k*sc)*VIDYA[l]: plotl (VIDYA, -VIDVA-);

Alternate Choices for Varying the Trend Period

The use of an exponential formula, either the simplified one shown by Kauf&nan or the traditional one of Chande, allows the smoothing constant to var according to the design of the user. There are indicators with which we are alreadj familiar that might be subatituted for the smoothing constant.

Correfotfon Coefficient

The most likely choice, suggested by Chande, is the correlation coefficient, r. This value is the result of measuring the residue from a linear regression calculation When the regression fit is very strong, the value of is near 1; when there is no apparent market direction, is near 0. This Tits neatly into the same pattem of smoothing constants as the KAMA and VIDY\.

\)¹en programming this technique, the calculation of rhe correlation of the residuals, requires the use of arrays and your ovm code for the correlation. This can be done using the formulas found in Chapier 3. To avoid that complication, the following program calculates a similar technique (Method I) by evaluating the correlation of the closing prices and a time series containing the sequential values 1.2,3,-- It then calculates the current value of the residual based on a linear regression of closing prices (Method 2) and finds the correlation coefficient, r, of the series of current residuak- In the foUowing programming code Method 2 is plotted, and the result of Method I is commented out.

{Adaptive R2 : Adaptive Correlation Coefficient Indicator Copyright 1997-1998, PJ Kaufman, All right&reserved. Plot smoothing function based on linear regression residual on simple time series function!



input: penodO);

var: R2(0), AR2(0), tiireseries( D), resitl(D), RRZ(D), ARRZ(C):

timeseries - CLrrentbar; IMethod 1; correlation of price and timeseriesI if currentbar <= period tben fiR2 = close else begin

R2 - (@correlation(close, timeseries, periodl + 1* Z: AR2 - AR2C1] + R2*(clOSe • AR2[1]):

end;

I plotl (AR2,-R2-);I

IMethod 2: correlation with current regression residuo I resid - close @1 inearregvaliie(close,pericd,0); RRZ - ¹correlation(resid, timeseries. period) + 1) 2; ARR2 - ARR2[1] + RR2*(clOSe - ARRZ[1]); plot2 (ARR2.ARR2);

Momentum Calculations

There are many momentum calculations, such as RSI, that varjfrom to 1, or fran -1 to+l.In most cases the trend is considered sfrongest when the momentum value is closest to the exfremes. The momentum values can easily be changed to fit the C-to-1 pattem of the smoothing constant by using the transformations

(1) ForarangeofOtol sc = @absvalue(H-.5)*2

(2) For a range of-I to+1 sc = @ebsvelue(M)

where s is the smoothing constant to be used for the current period M is the current momentum value

By reflecting the lower extreme around the midpoint of the calculation, then taking the absolute value, the transformed indicator shows a stronger trend near 1 and less direction nearO

Programming the Adaptive RSI

The following Omega code adapts the RSI a smoothing constant:

lACeptiue RSI : Adaptive Relative Strergtn Indicator Smoothing function based on RSII

input: perlodCZC); var: sc(0), ARSI(O);

if currentbar <- period then ARSl - close else begin

sc - (®absveluˆ(®RSl(cIose, period) / 100 .5)*2);

ARSl = ARSUl] + sc*(close - ARSUII);

end;

plotl (ARSl. "ARSl");

Comparison of Adaptrve Trends

Figure 17-1 shows three of the adaptive trending methods compared with a moving average, all based on a base calculation period of 2C. Kaufinans KAMA appears to be slightly closer to prices than Chandes VIDYA and flattens out faster during sidewajs periods; otherwise, they have similar characteriatics because they both use the structure of the exponential smoothing calculation. The adtive RSI (ARSl), used as a subatitute for the smoothing constant, is most responsive to price and appears as though it moves through the center of many of the sideways periods. Because the ARSl is much faster, it tends to get caught with a

false signal at the end of each sustained price move. The 2C-period moving average is reasonably smooth during this



maitet segment and shows tjpical characteriatics of lag. When conshiicting trading rules for any of these methods, the buy and sell signals are best if taten as the direction of the trendline and not a price penetration of the trendline.

McKinley Dynamics

Among the work produced by John McGinley is a list of popular adtive methods. His own New McGinley Dynamics is included:

MD - MD[1] (Close MD[1]) / (k*p*@powGr[(close/MD[1]),4)i

where MD is the current McGinley Dynamic

MO [ 1 ] is the previous McGinley Dynamic

IS a constant = .60 (6096 of a selected moving average period p> p is the moig average period cl ose is the closing price

The Parabolic Time/Price Sjstem

The first well-known adaptive technique was the Parabolic Time/Price Sjstem, which attempts to reduce the lag intrinsic to a trend sjstem. To do this. Wilder increased the speed of the trend by shortening the number of dajs in the calculation, whenever prices reached new profit levels. The philosophy of the Parabolic Sjstem is that time is an enemy. Once a position is entered, it must continue to be profitable or it will be liquidated.

I J"LiilJc3ttiley HTitesTecAiiiicBl Tren.t ill 792, fflilton, •TlOCrfi and has ciupiled a selection a.bptive tecluinjies as irell as .level oped tiie ones diEa--edliere

4j V.eHeEWil.ler,Jr,NewConce£.t.-inTecAiuicalTra4i,g£-yEten,EiTrendEeEearcL,3reenEb4-.. NC, 19-E)

FIGURE17-1 Comparison of moving average, KAMA, VIDYA,AR2, and ARSl.

Souice. Chari cfeatedurthTrdeSlalKHf by Omega ResearcTi In

The Parabolic Time/ftice System is ahvajs in the market; whenever a position is closed out, it is also reverse The point at which this occurs is called the Stop and Reverse (SAR). When plotted, the Stop and Reverse point seems similar to a trendline, although it has a decreasing lag (the distance between ttie current price and the ttendline, or SAR point, get closer each period), as shown in Figure 17-2. During periods of short, consistent ttending, the Parabolic SAR converges on the price ttend, exttacting excellent profits.

To calculate the SAR value, first assume a long or short position. If the maitet has recently moved lower and is now above the lows of that move, assume a long. Call the lowest point of the previous ttade the SAR initial point (SIP) because it will be ttie starting point for ttie SAR calculation (SARI = SIP). Calculate each following SAR as

SAR(todayj = SAR(priorj + AF(todayj x [High(,todayj - SARtprior)]



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