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?

  • $\begingroup$ 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. $\endgroup$ Jul 2, 2014 at 23:32
  • $\begingroup$ 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. $\endgroup$
    – user1300
    Jul 5, 2014 at 11:08

2 Answers 2


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.

However, in a stock exchange any complex pattern, when traded upon will quickly decay. Detecting a complicated pattern will generally not generate useful results, because it is typically complex patterns in the short term. Additionally, depending on the metric you choose, there are a number of ways of performing well that actually won't pay off in investing (such as just predicting the last value in your example).

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.

  • $\begingroup$ great thanks. I will evaluate robust regression and see how it goes. $\endgroup$
    – user1300
    Jul 5, 2014 at 11:04

Try a recurrent neural network, a model well suited for time series data. They're notoriously difficult to train, but seem to perform well when trained properly: http://cs229.stanford.edu/proj2012/BernalFokPidaparthi-FinancialMarketTimeSeriesPredictionwithRecurrentNeural.pdf


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.