Market Predictions

Top  Previous  Next

Market Prediction

A large number of our customers are using NeuroShell 2 for various financial market predictions.  Even if you are not planning to use NeuroShell 2 for this purpose, the following information is generally applicable to many types of numeric processing.

 

Normalizing Variables

Of course, as with all networks, the key to success is choosing the correct predictive variables.  Current prices, moving averages, lagged prices, price changes, and related indicators are good basic variables from which the network can start, but try to find indicators which precede a price change.  (Refer to the Market Indicator Package for help in creating indicators.)

 

There is, however, one basic suggestion which may increase your chance of success:  normalize some of your variables.  Let's see how and why this normalization works.

 

Suppose you wanted to use a price indicator as a variable which has a graph over time that looks like the following graph:

 

_bm27

 

As you can see, a distinct pattern is evident even to our own neural networks, but this could look like three different patterns to a neural network because they occurred at different price levels!  Ideally, we'd like to present the data to the network as in the following graph:

 

_bm28

 

The way to do this is to normalize the data.  There are many ways this can be done, among them:

 

1.  Use price relative to some baseline, such as the last 100 days' moving average.

 

2.  Use price relative to some index which could flatten the graph.

 

3.  Use change in price as well as price.

 

4.  Use percentage change in price as well as price.

 

5.  Use ratios of two variables to make 1 variable whenever possible.

 

Of course, you can avoid this normalization if you don't go so far back in time for sample patterns that the price levels were radically different.

 

Be Careful with Daily Prices

Price indicators tend to have a lot of noisy movement in them when viewed on a daily basis, so consider using a weekly or monthly price average instead of a daily price.  Daily price movements are extremely hard to predict, and using averages filters the data for you.  You might find it easier to predict next week's average price from last week's average price, or alternately, the change in average price expected by next week.

 

Adjusting Minimums and Maximums Correctly

Another situation to watch out for is using too broad a range between minimum and maximum.  Suppose your variable's graph looks like the following:

 

_bm29

 

There is a large spike at time x.  If you use the entire range [a,d] for your [min,max], you don't get much precision in the range [b,c] where most of the activity falls.  Is it really necessary to know how high the spike at x goes, or is sufficient to know that it hits at level c?  You might be better off using [b, c] for [min,max] unless there are a great deal of spikes.  Even then, consider adding another variable that is 0 when there is no spike, and gives the spike's value when there is one.

 

Indicators

Users doing financial applications or other time series problems may find it helpful to create additional input variables derived from the raw input data they already have.  These additional inputs are usually of the following types:

 

1.  Lagged versions of the raw data. For example, if your raw data is today's price and you are trying to predict tomorrow's price, then it may be helpful to include yesterday's price, and the price the day before as well.  You can do this even if you are using recurrent networks, but perhaps in that case less will be required.

 

2.  Averages of previous raw data (i.e., rolling averages).

 

3.  Changes (deltas) in the raw data. For example, you might want the difference in today's and yesterday's price.  You can also lag or average this too.

 

Refer to the Market Indicator Package for information about a NeuroShell 2 option that automatically creates these types of indicators from your raw data.

 

Predicting Market Direction

Often it is more fruitful to try to predict the price direction of a stock or commodity than either the price or price change.  Such a prediction is easier for the network, has features for obtaining a confidence level and cross checking, and often more closely represents what the trader wants to do anyway.

 

To predict the market direction, you usually want to know if a price will rise (by a given amount), fall (by a given amount), or remain the same (i.e, not move above or below the given amount).  The neural network to solve this problem will have three outputs (categories) which you can label BUY, SELL, and HOLD.  For each training pattern, only one of these outputs will be set ON (=1) and the others will be set off (=0).  This will depend on whether the price rose, fell, or remained the same for the period you want to predict ahead.  Since the training patterns are done with hindsight, you will know which of the outputs to set to 1, then train the network with Backpropagation.

 

Now when you proceed to use the network, you will get values between 0 and 1 in all three of the output categories.  This output can be used as a sort of confidence factor:  the higher it is the more sure the network is of it's answer.

 

Cross checking comes into play as you look at all three outputs together.  If they conflict, then you would not want to depend on the network.  For example, if BUY is .8, SELL is .7, and hold is .6, then the network was not very decisive.  If BUY is .3, SELL is .9, and HOLD is .4, then the network is much more decisive.

 

Since Probabilistic Neural Networks (PNN) work with categorical outputs, you may want to build a PNN net and compare it to your Backprop net.  In fact you may want to use both of them to get a consensus of "experts" before you trade.  PNN networks produce probability values as outputs, however, which are going to be harder to use as confidence factors.