C++ Neural Networks and Fuzzy Logic by Valluru B. Rao M&T Books, IDG Books Worldwide, Inc. ISBN: 1558515526 Pub Date: 06/01/95 |

Previous | Table of Contents | Next |

We cannot overstate the importance of preprocessing in developing a forecasting model. There is a large body of information related to the study of financial market behavior called Technical Analysis. You can use the mathematical studies defined by Technical Analysis to preprocess your input data to reveal predictive features. We will present a sampling of Technical Analysis studies that can be used, with formulae and graphs.

Moving averages are used very widely to capture the underlying trend of a price move. Moving averages are simple filters that average data over a moving window. Popular moving averages include 5-, 10-, and 20 period moving averages. The formula is shown below for a simple moving average, SMA:

SMA_{t}= ( P_{t}+ P_{t-1}+ ... P_{t-n})/ n where n = the number of time periods back P_{-n}= price at n time periods back

An exponential moving average is a weighted moving average that places more weight on the most recent data. The formula for this indicator, EMA is as follows:

EMA_{t}= (1 - a)P_{t}+ a ( EMA_{t-1}) where a = smoothing constant (typical 0.10) P_{t}= price at time t

Momentum is really velocity, or rate of price change with time. The formula for this is

M_{t}= ( P_{t}- P_{t-a}) where a = lookback parameter for a 5-day momentum value, a = 5

The Rate of Change indicator is actually a ratio. It is the current price divided by the price some interval, *a*, ago divided by a constant. Specifically,

ROC = P_{t}/ P_{t-a}x 1000

The Relative Strength Index (RSI) is the strength of up closes versus down closes over a certain time interval. It is calculated over a time interval T as :

RSI = 100 - [ 100 / (1 + RS )] where RS = average of x days’ up closes/ average of x days’ down closes

A typical time interval, *T*, is 14 days. The assumption with the use of RSI is that higher values up closes relative to down closes indicates a strong market, and the opposite indicates weak markets.

This indicator measures where in a recent range of prices today’s price falls. The indicator assumes that prices regress to their mean. A low %R indicates that prices are hitting the ceiling of a range, while a high %R indicates that prices are at their low in a range. The formula is:

%R = 100 x (HighX - P)/(HighX - LowX) where HighX is the highest price over the price interval of interest LowX is the lowest price over the price interval of interest P is the current price

This indicator makes use of other market data that is available besides price information. It uses the *volume* of the security, which, for a stock, is the number of shares traded for a stock during a particular interval. It also uses the *open interest,* which is the value of the total number of open trades at a particular time. For a commodity future, this is the number of open short and long positions. This study attempts to measure the flow of money in and out of a market. The formula for this is as follows (note that a tick is the smallest permissible move in a given market) :

Let MP = mean price over a particular interval OI = the larger of yesterday’s or today’s open interest

then

K =[ (MP_{t}- MP_{t-1}) x dollar value of 1 tick move x volume ] x [1 +/- 2/OI] HPI_{t}= HPI_{t-1}+ [ 0.1 x (K - HPI_{t-1})] / 100,000

The MACD (moving average convergence divergence) indicator is the difference between two moving averages, and it tells you when short-term overbought or oversold conditions exist in the market. The formula is as follows:

Let OSC = EMA1 - EMA2, where EMA1 is for one smoothing constant and time period, for example 0.15 and 12 weeks EMA2 is for another smoothing constant and time period, for example 0.075 and 26 weeks

then

MACD_{t}= MACD_{t-1}+ K x ( OSC_{t}- MACD_{t-1}) where K is a smoothing constant, for example, 0.2

The final formula effectively does another exponential smoothing on the difference of the two moving averages, for example, over a 9-week period.

This indicator has absolutely nothing to do with stochastic processes. The reason for the name is a mystery, but the indicator is composed of two parts: %K and %D, which is a moving average of %K. The crossover of these lines indicates overbought and oversold areas. The formulas follow:

Raw %K = 100 x (P - LowX )/(HighX - LowX) %K_{t}= [( %K_{t-1}x 2 ) + Raw %K_{t}] /3 %D_{t}= [( %D_{t-1}x 2 ) + %K_{t}] /3

Previous | Table of Contents | Next |

Copyright © IDG Books Worldwide, Inc.

C++ Neural Networks and Fuzzy Logic

ISBN: 1558515526

EAN: 2147483647

EAN: 2147483647

Year: 1995

Pages: 139

Pages: 139

Authors: Valluru B. Rao, Hayagriva Rao

Similar book on Amazon

flylib.com © 2008-2017.

If you may any questions please contact us: flylib@qtcs.net

If you may any questions please contact us: flylib@qtcs.net