Neural Networks in Trading: Beginning our Journey With A Small Introduction

To tell you the truth I have never been the biggest fan of neural networks in trading. My early experience with this type of programming technique proved to me that neural networks were great at over fitting data and very bad at making future predictions. However during the past year my interest in neural networks has increased as I have seen several ways in which we could apply them to improve – not only our current trading systems – but to come up with very universal, effective and perhaps reliable techniques to trade not only the foreign exchange but many other markets as well. On today’s post I will introduce you to the world of neural networks with a brief description of what they are, what they might be useful for and what they definitely cannot do.

Let us start by debunking some of the most common myths behind neural networks and their use. Neural networks are not a holy grail and they are NOT going to make the computer act “like a human”. For people who are not familiarized with programming neural networks sound like a very exciting thing to use since the mere name sounds complex but – in reality – neural networks are very far away from being anything like a human brain. In order for us to use neural networks in our trading we first need to understand what they are and why this programming technique can yield useful results in our trading.

A few decades ago, programmers and scientists where facing an important problem, the problem of non linearity in data series. The problem comes when we want to figure out “patterns” in the world around us but those patterns do not emerge because they are simply not very obvious. For example the falling of rain and the lunar phases might be related in some way but such a relationship is not easy to figure out. In order to find out if there are relationships and to draw predictions from those relationships the idea of data fitting started to come out. The birth of neural networks comes from a need to find a model for non linear phenomena to make meaningful predictions.

The need to come up with a model ended up with a brilliant idea inspired by the way in which the brains (a.k.a neural networks) of humans and animals work. The idea is that we have a ton of different functions (which we call neurons) which have different coefficients or “weights”, each one of these functions contributes to a given piece of the numerical answer which is then “spit out” in the end as a combination of the inputs of all neurons. The idea is that you will feed the functions some set of data where the answer is known (so that you can establish the function weights to get to this answer) and then you try the same functions (the trained network) on some data which the network has never seen to see if it yields any predictive value.

The basic idea of a neural network is then to simply take a group of functions, adjust them so that they predict some data and then test them on new data to see how they do. If the functions have been fitted in a way which is not meaningful they will not be able to draw any meaningful predictions while if they have some predictive value they will be a satisfactory model for the data you want to handle.

How these functions or “neurons” are placed within a network determines the network “map” or topology which is simply the way in which data is processed along the functions. A neural network usually has a set of  input functions which receive the data and then several layers of “hidden functions” which process the data in order to finally come up with an output function that gives you the answer. In the end the neural network will be effectively like a black box with hundreds or thousands of functions with different weights spitting out a given number with a certain input. One of the main draw backs of neural networks is that this lack of transparency makes the evaluation of possible failing scenarios almost impossible as the way in which the network is coming up with an answer doesn’t have any simple interpretation.

So neural networks – in short – are able to generate models for the prediction of non linear data series. When applied to trading there are several problems which make the application of neural networks difficult. First of all, any single series neural network will inevitably generate curve fitting and second input and output data must be relevant to a trading inefficiency (otherwise you’ll end up with data which is not useful for trading). We could think about using data from multiple pairs and fundamental sources to generate some relevant outputs for trading, something which I will treat on one of the next articles about neural networks.

Another very useful use of neural networks is in the improvement of trading strategies which are generated by other means (think manual or genetic generation) as the results of these strategies are also non-linear data series. By giving the neural network an input of all the entry characteristics and outcomes of a system the network could generate an entry or exit filter which could greatly help us improve the results of trading strategies. The most powerful use of this probably comes from the marriage of genetic programming and neural networks where genetically generated strategies are improved by a marriage with a neural network “improver” which is constantly retrained against the system’s results.

Neural networks are definitely a very interesting programming technique but the road with them is not easy and it is filled with deadly traps. Within the next few months I will publish several articles about neural networks and their use in trading, particularly on the usage of FANN and its application to trading data and system results in the generation of useful predictive models for both trading and system improvement. If you would like to learn more about my work in automated trading please consider joining Asirikuy.com, a website filled with educational videos, trading systems, development and a sound, honest and transparent approach towards automated trading in general . I hope you enjoyed this article ! :o)

Print Friendly, PDF & Email
You can leave a response, or trackback from your own site.

Leave a Reply

WordPress › Error

There has been a critical error on this website.

Learn more about troubleshooting WordPress.