The development of trading strategies using neural networks in Forex trading is challenging as the problem of figuring out proper input and output values that derive long term profitable results is not simple. The use of the most obvious input and output rules – like inputting candle closes to attempt to predict the next day’s close – usually leads to unprofitable results due to a general lack of predictive power over aspects that lead to significant statistical edges. In many cases this lack of a positive edge is also associated with a statistically relevant predictive power, something that is quite puzzling. On today’s post I will talk about the importance of separating different aspects of the market when making predictions and how this can lead to profitable trading setups using only neural networks.
When using a neural network to make trading decisions we must first train the neural network with some input and output values across a certain number of candles. To make a trading decision outside of the training space we then take only input values and act on the output provided by the network. If the neurons have figured out a true relationship between the inputs and the outputs we should be able to – in the long term – trade with a positive predictive power and statistical edge. However it is important to understand that – in order for this to be true – the actual success of the prediction must be related with the profit of the positions taken as a consequence.
–
–
For example if you attempt to predict whether the next day will be a bullish or bearish day you can in fact be right 60% of the time (have a statistical edge in your prediction) but a system based on this may have no edge. This happens because you can be right when candles are very small and wrong when candles are very big. What happens then is that you lose money because – although your predictions have an edge forecasting direction – they fail to anticipate how big or small the loss or profit you get will be. This is a common problem in the design of neural network systems, the output must be tied to profitability, a statistical edge in predictions should inevitably lead to a statistical edge in trading.
When we consider the above, it becomes clear that we need to predict both where the market is going and how far it is going. However the nature of both predictions is fundamentally different and attempting to tie them in the same output usually leads to terrible results. For example I could attempt to predict the next day’s close value and this will tell me both about where we are going (up or down) and how far we are going (how far from the open it will be), however the problem is that we can only judge the magnitude of the volatility prediction and we will have no information about the certainty of the binary prediction (the up or down decision). With this type of output you will know if you are to expect a small or a big candle – which allows you to judge whether or not to act on the prediction – but you won’t know how probable the up or down outcome is.
The best approach – in my experience up until now – is to use a combination to predict both volatility and directionality in different outputs. This is because both of them are very different variables that require different associations inside the neural network. What I usually get in the end is an output value tied to a normalized measurement of volatility (between 0 and 1) and another output which is tied to the probability of the next candle being bearish or bullish (-1 to 1). With this information I can then make a very informed prediction about the future candle, including the certainty I have that the next candle will be what I expect it to be. The results from this analysis are very interesting and reveal very important things about the inherent “noise” in currency time series.
–
–
One very interesting fact is that the neural network usually gives probabilities that are small, with the maximum probability for a 10 year testing period (training every bar with the past 100-400) being in the 0.6-0.7 range. This means that our certainty about directionality is rather bad since most of the time we are very uncertain about what the outcome for the next candle might be. This means that the information within a currency pair is not enough to accurately predict most bars with only a few bars from the whole lot being overly predictable. However this doesn’t mean that the neural networks cannot be profitable since the bars we can predict are usually within strong trending movements or strong reversals. Even though we only trade a handful of bars (about 10%) we can in fact get profitable results using this technique because the neural network itself tells us when we should stay out.
Hamuq, a project I started to build an oracle for several currency pairs using neural networks, is advancing with this implementation, hopefully leading to better tools and trading systems for Asirikuy in the medium/long term. The next step is to explore how directionality and volatility correlate across different currency pairs and whether or not introducing information for several pairs can increase prediction accuracy in others. If you would like to learn more about neural networks and their use in 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)