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]


99

for both training and execution of the model. The second is to avoid exponential moving averages, and use a simple moving average instead. The third is to compute an exponentially weighted moving average (EWMA), which eliminates the error. This approach can be used to replace the EMA itself as well as when applying an EMA smoothing to an indicator.

The n-period EWMA over p data examples is computed using the following formula. Notice that this formula requires the prior p values of the data for each computation. If you are writing your own technical indicators, this corrected or EWMA will often improve the performance and consistency of your system. At present, I am not aware of any commercially available systems that implement this:

>-*,,) -,

EWMA„Jt) = --

£0-*.)

where

n is the smoothing period

p is the window over which the exponential average is computed kn = l/(n + 1) is the smoothing coefficient x is the value of the time series at time t

EWMAn p(t) is the n-period EWMA evaluated at time t over p data points

One of the most popular uses of the EMA is in an EMACD oscillator. To construct an EMACD oscillator, compute the difference of a "fast" and "slow" EMA. The formula for the EMACD oscillator is:

EMACDfs(t) = EMAf(t) - EMAs(t)

where

f is the fast period, for example 3 s is the slow period, for example 14 EMACDC (t) is the result

The basic idea behind this is that when the time series is rising, the fast oscillator will respond more quickly than the slow one, and the result is positive. When a time series starts to fall, the fast again responds more quickly than the slow one and the result is negative. This difference is coupled with other logic to decide when to enter or exit a market.

Other technical indicators can be used to generate candidate inputs to a trading model. Examples include the Relative Strength Index (RSI), On-Balance Volume (OBV), directional movement indicators (PDI, MDI, DX, ADX, ADR). Two good references for examples of technical indicators are Colby4 and Eng.5 The monthly



magazine Technical Analysis of Stocks & Commodities also has good articles on technical indicators and their characteristics.

Trend Information

Trend information can be derived from a time series by use of statistical trends. Continuous wavelets have been helpful in identifying shapes such as double peaks. Several other mathematical tools are available for doing shape-based analysis.

In many situations, intermarket indicators are important. A variety of techniques can be used to extract this information. One of the easiest transformations is to compute the lineat correlation between two time series using a moving window. Linear correlation, sometimes called Pearsons-R is computed as follows:

RAu,v,t) = -

\ 1/2

p-\ p-] \

i=0 i=0

Rp(u,v,t) is the linear correlation over a window of p examples between time series u and v at end-time t

u is the first time series with data points u , u u

t t - 1 t - p

. v is the second time seties with data points v, vt j, . . ., v t is the current time

p is the period or window over which to compute the correlation

Applications such as long-tetm (12 months +) stock picking may use more long-tetm indicatots such as key ratios based on financial statements. When using long-tetm information, it is important to addtess the issue of when the information is available to make a decision. Fot example, quarterly sales and earnings reports ate often delayed at least one and sometimes two or more quarters. Moreover, when using historical databases, this infotmation is sometimes retrospectively updated. When using this type of information, it is essential to understand inherent delays and make allowances accordingly. Some companies have gone to the effort of actually taking weekly ot monthly snapshots of fundamental data from data providers to create a simulation envitonment that is as tealistic as possible.



PREPROCESSING FOR NONSTATIONARITY

At a conference, I asked a trader about his firms use of neural networks, and their effectiveness in the bull market of 1994-1995. His answer was that the company was badly burned by signals from their neural networks, and they no longer use them. Probing further, I discovered that the networks they were using had started giving "short" signals as the market moved up, and despite retraining continued to do so. After losing a fair amount of money, they simply gave up on the networks. What happened?

The networks were based on price data as input. When prices trended strongly upward, the networks saturated, and as they were pushed beyond the edges, the output went down rather than up. The resulting "short" signals were disastrous. Neural networks do not predict trending markets well.

When a time series trends strongly, it is said to be nonstationary. A stationary time series has a constant long-term average. In a nonstationary or trending time series, the long-term average moves significantly. Neural networks have demonstrated their ability to effectively predict stationary (nontrending) time series. They perform very poorly on nonstationary (trending) time series. There are several approaches to solving this problem. All of them involve converting the problem into one that is stationary.

When we remove level dependence from the inputs to a network, it will often generalize well even when the market reaches record highs. The new highs are not what it is looking at, but rather the relative shape and relationships between recent activities.

Even when price level is important, for such things as resistance levels, this can be transformed into a price-independent form. For example, a new indicator may be created that indicates the degree to which the price is close to a resistance or support level. Fuzzy membership sets are a convenient way of doing this.

Many technical transformations are level independent. Examples of level-independent technical indicators include stochastics, relative strength, and the directional-movement indicators. Price differences expressed as a percentage are also level independent. One issue to be aware of when applying certain technical transformations is the effect of missing data on the value of the indicator. Missing data can be caused by holidays, for example. The best way to handle this, either copying the last known value or eliminating the day, depends on the specific type of technical transformation.

Moving averages and exponential moving averages can be made price relative by dividing them by a longer moving average. For example, dividing all the moving averages by a 100-period moving average will not substantively affect the relationship between current values, but will create a general level independence. An MACD or EMACD oscillator can be made level independent by dividing it by the slower of the two moving averages.

A variant on this is to compute a rolling trendline. This is subtracted from all the prices to produce "detrended" prices. The trendline is added back into any price predictions to produce an adjusted trended price.



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