Top Menu


Right-Side Top Menu

Using Recurrent Neural Networks in Forex

April 17, 2013

Today, I present a new e-book for a free download from It is Using Recurrent Neural Networks to Forecasting of Forex written by V. V. Kondratenko and Yu. A. Kuperin from the Saint Petersburg State University. This scientific article has been published back in 2003 and was among the first ones to offer some real insight on the capabilities of neural networks to predict foreign exchange rates.

As it often happens with scientific papers written in Eastern Europe or CIS countries, the translation quality in this one is also very low. Despite this fact, the article is not too hard to read as it contains very few formulas and it relies on a small number of math concepts.

The authors use a recurrent neural network composed of 2 input neurons and 1 output neuron with 100 hidden neurons inbetween. Two data sets are used for inputs — raw price rate of change and a moving average with a period set to 5. This input combination proved to be the most effective of several variants they have tried. For the sake of simplicity and prediction usability, moving average one bar ahead is used as the output value. The resulting NN is trained over 1,200 daily bars of EUR/USD, GBP/USD, USD/JPY and USD/CHF. It is then tested on the set of 103 daily bars. The results show a rather significant inclination of the designed neural network to predict both the sign and the size of future currency rate change.

Sadly, the e-book is not without its disadvantages. In addition to the aforementioned translation quality issues, some of the statements look rather funny. As a predominantly weekly trader, I was particularly amused by this quote:

Besides of that, the forecast of weekly data presumes, that trader, who uses this forecast will trade once a week, which is irrelevant from the practical point of view.

Why is it irrelevant? Unfortunately, there is no further explanations given by the authors. I would also like to point out a rather low number of bars used for testing (production set). Increasing it to something comparable to the training set size would be a justified step. The choice of the immediate future moving average value as the NN’s output value looks also suboptimal to me. Actual rate values 5, 10 or 20 bars ahead of the forecast point would be more interesting for practical considerations.

If you have any questions, comments or suggestions regarding this e-book or about adding more free books to, please feel free to submit them in the comments below.

4 Responses to “Using Recurrent Neural Networks in Forex”

  1. Luca

    I’m trying to replicate a RNN as I’ve seen in this paper for my thesis.

    How could I calculate the predicted close value from the predicted moving average?

    Or how could I get some relevant information from the predicted MA?

    Thanks a lot!



    Andriy Moraru Reply:

    Calculating close value from a predicted MA value is quite simple actually. Considering 5-period MA. You already have 4 previous close values, so you just add them up and get Csum4 value. Then, calculate the predicted close: 5 × MA – Csum4.


  2. Luca

    Thanks Andriy for your reply :)

    Actually the problem is that my predicted moving average is quite similar graphically to real MA (65% to 70% correct prediction of increment or decrement of MA on 4 years).

    But when I transform MA in close value (with your formula) the correct prediction of sign of close value tend to 50%.

    This is MA prediction (prediction red, real blue)

    This is the poor close value prediction (prediction red, real close blue)

    Thanks for your help :)


    Andriy Moraru Reply:

    Apparently, it means that the method predicts MA disregarding the current Close values. You can have an infinite different sets of Closes that will result in the same MA value.

    So now, I am not really sure if it can help you trade successfully.


Leave a Reply

required (will not be published)

Subscribe to Monthly Forex Newsletter