Today, I present a new

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

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

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!

Luca

▼Reply

Andriy Moraru Reply:

January 27th, 2015 at 10:06 am

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 C

_{sum4}value. Then, calculate the predicted close: 5 × MA – C_{sum4}.▼Reply

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)

http://imageshack.com/a/img538/7269/7Od49e.png

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

http://imageshack.com/a/img538/8063/lFEYpK.png

Thanks for your help :)

▼Reply

Andriy Moraru Reply:

January 27th, 2015 at 3:11 pm

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.

▼Reply

Hi. I’ve been doing independent attempts to reproduce the experiments from this paper. I kept a journal of my experiments in my blog:

http://unixforex.blogspot.com/

A while ago I also wrote an article on a variation I made of Kuperin’s original experiments:

https://translate.google.com/translate?hl=en&sl=auto&tl=en&u=http%3A%2F%2Fcienciadesatada.blogspot.mx%2F2015%2F04%2Fred-neuronal-recurrente-elman-con.html

I also have some criticism about the quality of the results shown in the paper. I’ve actually obtained better “R squared” scores by using a trivial prediction method. I describe this method here:

https://docs.google.com/document/d/1PE2vJcHmYtQNk5GS110QhNYIVHj6k80hiZdO12mv11w/pub

My trivial prediction method easily outperforms Kuperin’s neural network, when evaluated by the same standards shown in the paper.

▼Reply

Vicente Mier Reply:

July 1st, 2015 at 12:07 pm

By the way, there’s actually a published Springer article about the exact same method Kondratenko and Kuperin use in theirs. It’s also co-authored by Kuprin. I’ve read the article, and there’s nothing you wouldn’t find in ” Using Recurrent Neural Networks to Forecasting of Forex”. If anything, there are less details:

http://link.springer.com/chapter/10.1007/3-540-47789-6_127

▼Reply

Andriy Moraru Reply:

July 1st, 2015 at 6:30 pm

Thanks for sharing your research in such a great detail! That was very insightful reading. I now feel inspired to do some more research into NNs and predicting algorithms. It is also nice to see the code shared – not many developers do that.

▼Reply

Vicente Mier Reply:

July 2nd, 2015 at 2:10 pm

You’re very welcome, Mr. Moraru. I try to follow the 4 freedoms of open-source software. So feel free to download, read, and modify the code.

I wrote a bunch of C code and bash scripts for this project, but I didn’t comment the source files properly. Si if you have a hard time understanding what’s going on in the code, don’t hesitate to e-mail me with any questions.

I think Kuperin’s work on financial forecasting using SRNs is very innovative. But because it is so avant-garde, it may come with a few quirks. I tried many different things to try to get it to a point where I could use it to profitably predict market trends. But I believe further research is needed.

There’s relatively little research being done today on recurrent neural networks, so I think it may be a while before we see any exciting results on the matter. But that’s just my personal opinion.

▼Reply

Kuperin states that he can predict approx 80% of the increment signs. Isn’t that enough for profitable trading?

▼Reply

Andriy Moraru Reply:

September 15th, 2015 at 3:57 pm

Depends on what kind of increment signs he can predict. If that’s 80% chance of gaining 1 point vs. 20% chance of losing 5 points, it is not profitable.

▼Reply

As it turns out, predicting increment signs with 80% accuracy is not all that hard.

I’d suggest you try the following experiment:

Take any currency exchange rate history dataset and take a few subsets from it. Now, perform the following trivial prediction algorithm on those subsets:

For each increment sign in the subset, predict that it will have the same direction as the previous increment sign.

You’ll notice that just out of sheer luck, some (many) of your subsets will turn out to have 80% correct predictions.

Kuperin’s neural network uses one exchange rate value from a previous day to predict the value from the day next to it. Their neural network might as well just be spitting out predictions with a value close to the value from the previous day (from it’s input). This should be enough to produce an 80% hit rate for some data subsets.

Kuperin et al only tried their algorithm with very few subsets. Perhaps they did something like the experiment I suggested here, and cherry-picked the sub-sets more likely to produce favorable R-squared and increment sign hit ratios, so that the numbers would look good on paper.

▼Reply

Just to reiterate: I myself have performed this experiment. I haven’t tested it for the increment signs. But I have for the R-squared results. It turns out that a lot of subsets show an R-squared greater than 0.6 (which is the best that Kuperin et al got), when using my trivial prediction method:

https://docs.google.com/document/d/1PE2vJcHmYtQNk5GS110QhNYIVHj6k80hiZdO12mv11w/pub

https://github.com/vomv1988/kuperin_forex_srn

▼Reply

Sorry: the best they get is something around 0.69. Well: I get up to 0.74, and I don’t even use a neural network. I just predict: “Tomorrow’s value will be the exact same as today” on a bunch of data subsets, and my R-squared results range from 0.3 to 0.74.

It would be interesting to see what their neural network gets when tested against a dataset where my trivial method gets a low R-squared score, such as 0.3. I would suspect that their neural network won’t get anything much higher. If any.

Of course, Kuperin et al did not share any code or datasets. So I guess we’ll be left wondering.

▼Reply

Oh, and one more thing: Kuperin doesn’t predict the increment sign for the exchange rate itself, but for the Moving Average of the logarithmic Return Rate.

That makes it even MORE likely that the increment sign of the previous day be the same as the sign for the next day, because the moving average actually Smoothens the return rate fluctuations.

▼Reply