# Foreign exchange market forecasting with neural networks

I would like to use ANN to automate trading currencies, preferably USD/EUR or USD/GBP. I know this is hard and may not be straightforward. I have already read some papers and done some experiments but without much luck. I would like to get advice from EXPERTS to make this work.

Here is what I did so far:

1. I got tick by tick data for the month of july 2013. It has bid/ask/bid volume/ask volume.
2. Extracted all ticks for the time frame 12PM to 14PM for all days.
3. From this data, created a data set where each entry consists of n bid values in sequence.
4. Used that data to train an ANN with n-1 inputs and the output is the forecasted nth bid value.
5. The ANN had n-1 inputs neurons, (n-1)*2 + 1 hidden and 1 output neuron. Input layer had linear TF, hidden had log TF and output had linear TF.
6. Trained the network with back propagation with n-125 first and then 10.

For both n, the MSE did not drop below 0.5 and stayed at that value during full training. Assuming that this could be due to the time series being totally random, I used the R package to find partial autocorrelation on the data set (pacf). This gave non zero values for 2 and 3 lags only.

Question 1: What does this mean exactly?

Then I used hurst exponent to evaluate the randomness. In R, hurst(values) showed values above 0.9.

Question 2: It is supposed to be nearly random. Should it have a value closer to 0.5?

I repeated the training of the ANN with n=3. The ANN was trained and was able to obtain a pretty low value for MSE. However, the calculated output from this ANN does not differ much from the (n-1)th bid value. It looks like ANN just takes the last bid as the next bid! I tried different network structures (all multilayer perceptions), different training parameters, etc, but results are same.

Question 3: How can I improve the accuracy? Are there any other training methods than backpropagation?

• I'm not sure if you'll do better than predicting 1/f noise when using past values as indicators for future ones. scholarpedia.org/article/1/f_noise#Stock_markets_and_the_GNP - your results so far seem consistent with that. Probably you should look at other possible features that have some reason to correlate with future exchange rates. If this were easy, there would be more rich data scientists. – Neil Slater Jul 2 '14 at 23:32
• yes, Maybe other variables are contributing to the next value more than the time series values it self.. I will experiment with that too. Thank you for the pointers. – user1300 Jul 5 '14 at 11:08

The results you're seeing aren't a byproduct of your training product, but rather that neural nets are not a great choice for this task. Neural nets are effectively a means to create a high order non-linear function by composing a number of simpler functions. This is often a really good thing, because it allows neural nets to fit very complex patterns.
In addition the stock market is startlingly chaotic which can result in a neural net overfitting. This means that the patterns it learns will generalize poorly. Something along the lines of just seeing a stock decrease over a day and uniformly deciding that the stock will always decrease just because it was seen on a relatively short term. Instead techniques like ridge and robust regression, which will identify more general, less complex patterns, do better.
The winner of a similar Kaggle competition used robust regression for this very reason. You are likely to see better results if you switch to a shallow learning model that will find functions of a lower polynomial order, over the deep complex functions of a neural net.