Using Neural Networks to Predict Values

 

Neural networks are mathematical models that are inspired from studies of the brain and the nervous system. They are similar to the brain in that they learn by experience, using data to build a map from a set of inputs to one or more outputs. In mathematical terms, neural networks are adaptive, non-linear systems that model data based on known values. And, once a neural network model has been trained on a set of data, it can be used to classify unknown conditions or predict future values.

&  For an overview of how neural networks work, see What is a Neural Network?

 

Predictions in TradingSolutions require a set of inputs and a desired output in order to create a model. For example, if you were trying to predict what the closing price of a stock will be three days from now, you would train the prediction using whatever historical data was relevant to the movement of the closing price as inputs and previous closing prices as desired outputs. The prediction could then be used with the current values of the inputs to predict what the closing price would be in the future.

 

Like other values in TradingSolutions, predicted values are stored in fields. These values can be displayed in a chart or used to create other fields, such as calculations or trading signals. Therefore, when you want to create a prediction, you do so by creating a new field to hold a predicted value.

 

&  For a step-by-step introduction to this topic, see the tutorial called Making Your First Predictions.

Creating a New Predicted Field

To create a predicted field, open the Create a Field Wizard and select to create a new field to Predict or model a value. This will begin the Predict a Value Wizard.

Selecting a Desired Output

When you create a predicted field, you begin by selecting a field that holds the history of the value you are trying to predict. This is called the desired output. The desired output can be any field you would like to predict, including price data, financial indicators, and optimal signals.

 

The Predict a Value Wizard begins with the Select Desired Outputs page. This page allows you to indicate which field you would like to predict, along with how far in advance you would like to predict it for.

 

You can select to preprocess the desired outputs by predicting the change or percent change in the value, rather than the actual value. This is useful for predicting values such as price data, where new values are strongly related to preceding values. By default, non-signal data is automatically set for preprocessing.

Ä    Note: Preprocessed outputs are also post-processed so that the predicted value is in the same scale as the desired value.

 

When you select a desired output, you must also specify a name for the predicted field. TradingSolutions provides several suggestions for names for the new field based on the field being predicted. Any of these names can be used directly from the combo box, or you can enter your own. The name of a field should be something meaningful so that you know what the values in the field represent.

 

Most predictions have a single desired output. However, it is also possible to create neural network models that produce multiple predictions. This may be useful when predicting interrelated fields, such as high and low prices for a trading day. The Select Desired Outputs page allows you specify multiple outputs.

Selecting Inputs to a Prediction

After you have selected the values you are trying to predict, you need to select a set of fields to use as inputs on which to base the model. The selection of inputs is the most important aspect to creating a useful prediction, as it represents all of the knowledge that is available to the model to base the prediction on. Conversely, if you put useless garbage into a neural network, you will typically get useless garbage back out.

 

The Select Inputs page of the Predict a Value Wizard allows you to select which data fields to provide as inputs to your prediction. The data fields can be from the same data series as the desired output or from any other data series in the portfolio.

Ä    Note: If a data field is selected from a data series that does not have the same dates or periodicity as the target data series, TradingSolutions will use the last known value as the input. For example, if quarterly data is used for a prediction in a daily data series, the value from the preceding quarter will be used until a new quarter is reached. This holding of values can also be seen when charting values from different data series or displaying them in a spreadsheet.

&  For more information on working with multiple periodicities, see Understanding Periodicity.

 

Any number of inputs can be used for a prediction. However, it is possible to provide too many inputs to a neural network. If a model is trained with lots of irrelevant inputs, it may take significantly longer to train or not be able to train at all. And, if a model is trained with many inputs for a relatively small number of samples, it may be subject to over-training, in which the model simply memorizes the training data and doesn’t do well at predicting new values.

Ä    Note: Users familiar with neural network concepts occasionally ask if their inputs need to be "normalized". TradingSolutions neural networks automatically normalize all data that is fed into them so that you don’t have to worry about this additional step.

Selecting a Neural Network Model

The next page in the Predict a Value Wizard is the Select Options page. This page allows you to set general options for how to make your prediction. By default, TradingSolutions will select appropriate pre-configured options for the type of prediction you are making. In most cases, beginning and intermediate users can simply continue from this panel without changing any options.

&  For help with Custom Solution Wizard DLL’s, see Developing Models with NeuroSolutions.

Using the Predicted Fields

Predicted fields can be used like any other fields. Predicted price values and indicators can be displayed in charts and used in calculations and trading systems. Predicted signals can be displayed in charts and analyzed for profitability. You can even use predicted fields as inputs to other predicted fields.

 

&  For a step-by-step introduction to this topic, see the tutorial called Making Your First Predictions.

&  For more help with predictions, see Predicting and Modeling Financial Data.