Selecting Indicators

<< Click to Display Table of Contents >>

Navigation:  Chapter 5 - GeneHunter Examples in Excel >

Selecting Indicators

Previous pageReturn to chapter overviewNext page

Example File:  INDICATE.XLS

Solution Type:  Continuous Chromosomes

 

The workbook INDICATE.XLS contains a worksheet called Indicators that is the basis for this example.  This workbook is located in C:\GENEHUNTER\EXAMPLES\EXCEL if you chose the default directory during installation. (If you install the entire AI Trilogy set of programs, the GeneHunter folder is a subfolder of the C:\AI Trilogy folder.)

 

In the field of financial analysis (and other fields where forecasting a time series is important) there is often a need to be able to find "technical indicators" that help forecast the movement of a stock, commodity, or other time series. These technical indicators are time series themselves and (hopefully) have components that are predictive of the future movement of the original time series that needs to be predicted.  They are sometimes used by themselves to help predict the original time series, but more often they are fed as inputs (independent variables) into a neural net, regression, or other model attempting to make the prediction.  The idea is that the technical indicator will reveal information to the model about the past performance of the time series. If past performance of the time series is indicative of the future performance, then the information input to the model should be useful in the prediction, provided your indicator portrays the useful information. This example will show you how to build an optimized technical indicator using other standard technical indicators as building blocks.

 

The idea here is to take already known technical indicators and build a combination of these indicators in order to create a new and hopefully more appropriate indicator. We will use three well known, simple technical indicators called momentum, velocity, and acceleration.  We will show you the definitions (formulas) of these indicators later. This problem does not require the use of these particular indicators, and you are encouraged to try any others you feel may work well. Any reasonable number of these may work as well, not just three.

 

Our example builds what is known as a "linear combination" of these indicators:

  a * momentum + b * velocity + c * acceleration

where a, b, and c  are variables for which GeneHunter will find the best values. There is no reason why this example might not be generalized to find a "non-linear combination" like:

  momentum*a^p1 + velocity*b^p2 + acceleration*c^p3

where GeneHunter finds the positive integer powers p1, p2, and p3. You could also make more complex models involving terms of trigonometric functions like a*(sin(momentum))^p.

 

We will, of course, need a fitness function. One good one is correlation. If we build a technical indicator which correlates well with the movements of the original time series, then there is a chance that the new indicator is predictive. There is a possibility, however, that the indicator is simply "following" the time series instead of providing "leading" information, so there is certainly room for more complex fitness functions.  For this example, though, we will use correlation. We would like to maximize the correlation between today's value of the indicator and tomorrow's closing price of the stock. Naturally, we could have used another look ahead period if that was preferable. We utilize the Excel statistical correlation function called "correl" for the correlation.

 

 

_bm40

Figure 5.19  Data and fitness function for the Indicate example.

 

Here are the definitions of the three technical indicator building blocks we used:

momentum - the difference between tomorrow's close and the close N1 periods back.

velocity - the slope of the line between today's close and the close n2 periods back = momentum/N2.

acceleration - the slope of the line between today's velocity and the velocity n3 periods back = velocity/N3

 

Note that we are letting GeneHunter find N1, N2, and N3, which are in cells H9:J9. Note also that the computation of correlation does not begin until row 111. We have done this to provide plenty of look back room for N1, N2, and N3.