Artificial Neural Nets (Part 1 - Introduction)
Over the next couple of postings I want to write a series of blog entries on trading using Neural Networks. I am writing this series of article because I know very little about neural networks. By writing these articles I am teaching myself a new topic.
This first article will look at how Neural Networks can be applied to trading, their advantages and disadvantages. In the next posting I will do a review of one of the popular Neural Network EAs.
What is a Artificial Neural Network (ANN)?
An artificial neural network (ANN), is a computer simulation of an inter-connected group of artificial neurons. The intention of an ANN is to simulate the principles how humans and animals think by modeling the flow of information between neurons, and the activation and firing of neurons which leads to outcomes. While the “thinking” bit is a broad stretch, using the paradigm of interconnected sets of artificial neurons allows a number of interesting problems to be solved, including:
- Function approximation (e.g. regression analysis, time series prediction, etc);
- Classification (e.g. pattern and sequence recognition, novelty detection and sequential decision making); and
- Data processing (e.g. filtering, clustering, blind signal separation and compression).
Of most interest to traders is obviously prediction of time series as it will allow prediction of future prices, future values of technical indicators, future values of economic indicators, etc.

ANNs rarely if ever consist of a single neuron. Rather they typically consist of a network which consists of an input layer, an output layer and zero or more hidden layers of at least two layers of artificial neurons and one or more hidden layers.

- A naive network which takes the last K closing prices (usually normalized by using log returns) and predicts the price a few bars ahead in the series
- A single indicator based network takes in the last K values of an indicator (e.g. Stochastic, RSI, exponential moving average) and tries to predicts the indicator a few bars ahead in the time series
- A composite indicator based network which uses inputs from a number of indicators and provides outputs on wether to go long or short
- An intermarket analysis network which takes in the prices of several markets and provides outputs on wether to go long or short
- A fundamental based network which builds on an intermarket analysis networks and has several other kinds of inputs in it based on economic variables such as interest rates, GDP, consumer confidence, etc
- Supervised learning: The aim is to train the ANN to be able to reproduce a known set of outcomes. This is the most common form of learning used in trading. The neural net is trained to be able to predict future values of some time series (e.g. price, some economic indicator, interest rates, the value of an indicator, etc);
- Unsupervised learning: The aim is to train the ANN to minimize or maximize some function. This is commonly used in estimation problems such as statistical modeling, compression, filtering, blind source separation and clustering. An example use of unsupervised learning in trading might be to use a neural network to aid in position sizing; and
- Reinforcement learning: This is a form of unsupervised learning where the ANN interacts continuously with the environment and reinforces its learning from the environment. This is typically used in control problems, games and other sequential decision making tasks. Reinforcement learning in trading could be used for trade management (e.g. when to pyramid, when to scale out, when to stop and reverse, etc).
Unsupervised learning and reinforcement learning are typically not used in trading. Supervised learning is by far the most common approach.
There are numerous algorithms available for training ANNs and most of them can be viewed as a straightforward application of optimization theory and statistical estimation. Most of the algorithms used in training ANNs employ some form of gradient descent where the input weights are initially assigned random values and progressively adjusted until the ANN meets its objective function.
The most common way for trading ANNs to be trained is through a process of what is called back propagation. Back propagation works by processing a training sample of data, comparing the outputs of the network to the desired output, calculating the error factor of the output and adjusting the input weights of each neuron by using a scaling factor based on the error factor. If the network weights cannot simply be adjusted, the “blame” for the error is pushed back to the hidden layers. If this process fails, then the “blame” is propagated back again deeper into the network until the network reproduces the training set.
NN Products
There are a number of NN trading products on the market for trading forex, including:
- Bogie Enterprises, Bogie-NN (to be reviewed in my next entry)
- TraderTech’s, Vantagepoint which uses an ANN for intermarket analysis
- Neuroshell Trader which provides a toolkit for building neural nets
- Wealthlab Neural Net Plugin which provides a tool kit for building neural nets for trading
Strengths and Weaknesses of NNs in Trading
In the context of trading, ANNs are really being used as a means of undertaking multiple linear regression. This means that as long as market conditions are similar to those in which the neural net was trained its performance will be exceptionally good. For example, if an ANN was trained on a trending market and the market is currently trending, then the ANN is likely to help you kind optimal entry points. However, if the ANN was trained on trending markets and the market is currently ranging, then it will perform quite poorly. In developing ANNs, filtering markets is an exceedingly important topic to ensure that when the ANN is applied to the market it is trading the right kind of market it is optimized for.
Also, the edge an ANN provides can go away. For example, in the late 80s and early 90s, when the hype around neural networks was at it’s peak of the hype cycle, naive neural networks were performing exceedingly well. Then all of a sudden, the honeymoon was over and they stopped bringing in the profits. What actually had happened is the market had become too efficient because these methods had become too popular, and whatever edge the network had was lost.
Next Article
In the next article I will do a review of the Bogie-NN expert advisor.



August 12th, 2008 at 7:17 am
hello dear sir, andar here. i enjoy post of yours very much so. i am agree to you. good day.