When building neural networks (NN) in trading the most important thing you need to consider is how you will structure your inputs and outputs to get meaningful and successful generalizations and, therefore, predictions. Most of the attempts you will find within the research literature dealing with the development of NNs for financial time series use a typical linear input method where you give your neural network something like the closes of the past 10 weeks and you expect to predict the close for tomorrow. However when we think about how the neural network must have all relevant information to make a trading decision it becomes clear that this method has some serious disadvantages. Within this post I will talk about these disadvantages as well as a new and revolutionary method – which I found in the literature – to make the neural network “see” things much more like you and me do! The images showed in this post were taken from this article.
First of all let us see what is wrong with the linear input methods that we usually use to build NNs to predict financial time series. The neural network sees a string of values for some input but it doesn’t have anything that tells it the relationship between the values you give it. For example the neural network may know that the closes 1.2, 1.3 and 1.4 lead to the close 1.1 but it doesn’t know that 1.2 came first, then 1.3 and then 1.4 because when you give inputs in this way there is no established relationship between the values. The problem with this is that the NN finds it very hard to make generalizations because the data may appear random. What happens in this case is that you tend to curve-fit to values in training and out of sample results tend to fail quite dramatically.
If we want the NN to give us outputs that are meaningful we may need to give it information that is equivalent to the information we use as traders to derive our trading decisions. What you are doing by giving the NN a string of close values (or another similar input) is alike trying to trade by reading a tape with values, trying to figure out the connections. The NN has some problems doing this as the information that you are giving it is incomplete. Giving it all the information in the form of OHLC won’t help either since this would be equivalent to reading a tape of OHLC values (would this help you out?). In essence the price levels on the chart are quite irrelevant (the actual values of a candle’s OHLC) the only thing that matters is actually the geometrical patterns formed by price on the charts.
The key my friends, is the chart. I would say that the vast majority of technical traders make decisions based almost purely on visual information, it doesn’t matter what the values of the OHLC of the past 100 candles on the screen are, what matters is the way in which these values “paint a picture” on the screen. It would be irrelevant if these values were what they are or if they were multiplied by 10, the actual result of the analysis regarding whether to go long, short or avoid trading would still be the same. This means that the information we have been attempting to feed an NN is extremely sub-optimal, what the network needs is not the OHLC data (or something derived from it), what the NN needs is the actual picture.
But how do you make the NN “see” the picture? Well, you literally train it with the picture. You can take an image of a chart and by using image processing techniques you can make the NN see a canvas of grey, black and white pixels that will allow it to draw clear connections between the geometrical patterns on the chart and buy/sell/neutral predictions. You train the NN with an image of a resolution high enough to depict the geometrical patterns and you use a single output neuron as a trading decision. The idea is that with this training the neural network will be able to evolve a clear view of what type of geometry leads to what prediction. For example the network may realise that certain shapes on the chart imply that a long is likely to success while others imply a reversal. The best way to use this is probably to train the network on a lower time frame image than the time span you want to predict, using the – for example – the 1H chart to make decisions regarding direction for the next 24 hours.
The best thing is that someone already tested this and published an article with the results (you can read it here). The results show that the use of an evolutionary neural network model that looks at pictures of charts instead of actual OHLC or indicator data does have a much more powerful capability to generalize and make profits than the traditional neural network approaches. This is extremely interesting and points to the way in which we might be able to create new NN strategies. This also opens up the way to other possibilities, what happens if you show the NN renko charts or fixed volume charts? What happens if you show it multiple time frames ? if you show it multiple currencies ? The sky is the limit to the way in which this can be explored.
Of course this endeavour is quite complex as it requires careful synchronization of image saving and fast image processing capabilities, coupled with code to process the images and finally train the NN. However once the first implementation is made it should be easy to come up with a lot of trading solutions. Next year one of my goals will be to develop an NN strategy using image recognition so that we can use it to increase our understanding within the Asirikuy community. Hopefully this will add a lot of power to our current NN trading arsenal, it will be very interesting to see how this image processing approach tackles the multiple-instrument problem.
If you would like to learn more about our work and how you too can learn more about neural networks in Forex 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)