Neural Net Module

Items Covered in This Section

Introduction

By now you have learned how to do the very basics of Timing Solution Software: You have learned how to download price history data that you can use for your future forecast; you have learned how to apply Spectrum Analysis ("how to use periodograms" may sound better?) to the price charts; and you have learned how to create a forecast based on Astronomical cycles.

Now you will learn about the third popular module - Neural Net Module. While Neural Nets have been gaining popularity for their ability for image processing and facial recognition, they also have proven useful in analyzing the financial market and forecasting future price movements (that last part of the text has to be edited).

But what is Neural Net? Before you use the module it is a good idea to learn idea behind Neural Networks. If you are already familiar with the concept you can go to the next section about how to use the Neural Net Module here.

Neural Net Explained

The main definitions of Neural Network (NN) are: inputs (the same as input layer), output (the same as output layer) and hidden layer/layers.

Let's me explain the NN idea with meteorology example. Suppose we need to make a weather forecast, i.e. for tomorrow (as an example) we need to forecast temperature, precipitation conditions (rain, snow, drizzle ... clear), air pressure, wind. These are two parameters we call output, i.e. this is what we need to FORECAST. We can display outputs this way:

OUTPUTS WE WANT TO FORECAST: tomorrow temperature, tomorrow precipitation condition, air pressure and wind.

Next question is: what is our forecast is based on? What data we want to use to build weather forecast.? This is what we know already.

We know the weather today, this event is already happened. We also know the weather condition yesterday, two days ago etc. We also have a lot of satellite information regarding fronts movement. This is input, this is information that will be used to "cook"  forecast for tomorrow weather. We can display inputs this way:

 INPUTS, THIS WHAT WE KNOW ALREADY:AND WANT TO USE THIS INFORMATION TO GET FORECAST: weather today, yesterday, two days ago etc. satellite information for today, yesterday, two days ago etc.

The most tricky thing here this is hidden layers. This is core core of Neural Network technology, this is what allows to build NON LINEAR models. If we speak about linear models we deal with models that provide linear relation between inputs and outputs, in other words for each input event we can find weight how this input event affects input. As an example tomorrow temperature can be calculated with formula like this:

Tomorrow temperature = 0.9 * today temperature - 0.17* yesterday temperature + 0.012* today pressure etc.

It was just an example, the reality is much more complicated that linear formula above. In reality we can get more complicated relations like this (this is just an example as well):

1) if today temperature and pressure is high - temperature tomorrow is also high

2) if today temperature is high and pressure is low - temperature tomorrow is low

3) otherwise temperature tomorrow is the same as today temperature

Here temperature and pressure here work together, we can not separate temperature and pressure effects. In nonlinear model the effect of pressure depends on temperature. While in linear model we can isolate temperature and pressure effects, as in an example above the effect of temperature is 0.9 and effects of pressure is 0.012.

The hidden layer/layers allows/allow to reveal these nonlinear patterns. The more hidden neurons and hidden layers we have the more complicated nonlinear pattern NN can reveal.

Schematically Neural Network looks this way:

 

This kind of NN is called multilayer perceptron.

The next step is Learning/Training of Neural Network. This is process of adjustment NN using available historical data, i.e. the information that we know already. As an example as output we take weather condition today (we know this information already) and input we take weather condition yesterday, two days ago etc. Using this info we correct our NN to get better better accuracy between the weather that NN forecasts and already know weather.
Next step: we take weather yesterday as output and as input weather two, three etc. days ago and correct our NN once again. This way we get the best coincidence between what our NN forecasts and real weather condition.

In Timing Solution we apply back propagation algorithm to train NN.  Now let's show how this routine works in Timing Solution.

Using Neural Net Module

To open the Neural Net, click the mouse here:

Neural Net Outputs

The Neural Net Window is divided into three steps. Unlike most mathematical models, the first step will select our output. That is what is the result that Neural Net will compare our model against. To select an output click the button shown in the picture below:

 As an example, let us forecast the detrended oscillator with the period of 50 bars:

To do so, select "Relative Price Oscillator" from the Drop Down Menu. Below the selection, you can set various parameters that pertain to your selection. In this case just make sure MA2 and MA3 are both set to 50.

This is called RPO50 - relative price oscillator with the period of 50 bars (this is the same as percentage price oscillatr). Selecting this detrends the price data (gets rid of any steady movement up or down). Detrending is necessary to do, as Neural Network works better with detrended indicators (it looks for real connections between the price movement of your financial instrument and things that form your model; the existence of a trend confuses this search).

After that click the Try button. This will preview the detrended data in the lower left part of the window. After that you can Click "OK" to load the output into the Neural Net Module.

Neural Net Inputs

The next step is to define our inputs (the model that we want to test against our output, or in other words, find any correlations between our model and the output defined above).

You can either click on the main Criteria button and create a model yourself, or you can click the "+" button and choose from a selection of pre-made models.

In this case we define the Ptolemy aspects that are used to forecast RPO50 with the orb of 15 degrees.

Training Neural Net

Now it is time for Neural Network to start a learning procedure. This is where the Neural Net's Hidden Layer does the calculations to find any relationships between the input and the output. We do that on the training interval (which is located before LBC). To start training click here:

In seconds your Main screen will look like this:

As you can see, the projection line (a red curve) describes the RPO50 (a black line) very well inside the blue (training) interval. That was the goal - to train the Neural Net until it finds the parameters of our model that make it fit well to the price oscillator.

The projection line also extends into the red zone (after LBC). It does not do any calculations there, you are strictly seeing the projection line created by training in the blue interval (before LBC) and the relative price oscillation after LBC. The program does not use the data after LBC to adjust the projection line. If you want to see how the projection line performs at any point on the price history chart you can select the magnify cursor button and then select the appropriate area on the chart examine it.

It shows the correlation calculated for the selected interval. While you choose different intervals, the program recalculates this information panel, so you can see how the projection line fits the price on different intervals.

When you decide that Neural Work projection line is OK (it fits the price quite well on different intervals), click "Stop" button to stop the training procedure:

The projection line created by the Neural Net is automatically shown in the Main Window. If you, do not want to see it, you can click on the button. Pressing it will get rid of the NN results panel in the lower portion of the Main Window. If you do not want to see the NN results panel but want to still see the projection line, then click on this button .

Auto stop

You may set auto stop feature here:

In this example Neural Network stops training when the correlation between  the price and the projection line created by Neural Network reaches 15% at least.

You can define more complicated auto stop criteria:

Here Neural Network stops training when the correlation between Neural Network projection line and the price reaches 15% at least OR when the correlation between Linear projection line and the price reaches 36% at least.

Another example involves the amount of training steps:

Here the program stops Neural Network training when the correlation reaches 15% OR  the amount of training steps reaches 100K steps.

Remember that typing 15% means that we indicate the correlation, while typing 100K means the amount of training steps.

This concludes the lesson on Neural Net. The next lesson will cover Charting tools and how they can help you in creating your forecast.