Forex Strategy Tester and R-squared: Improve Your Equity Line


Forex Strategy Tester is a key point when we trade with Expert Advisors.

Forex strategy tester and the R-squared improvement is what we will talk about in this lecture.

My name is Petko Aleksandrov from EA Forex Academy and today I will talk about the R-squared which we have as an improvement in EA Studio Forex strategy tester, and we have it as additional criteria to our trading strategies.

Forex strategy tester is a great tool that algorithmic traders use. It allows the trader to test any strategy before it is placed on the platform for trading. This saves a lot of time, effort and resources.

EA Studio is not just a Forex strategy tester.

It combines many analytical tools such as the R – squared. Also, it has the generator which works over the historical data of the broker. This means that even you do not have any profitable strategies, it will generate your strategies according to the predefined acceptance criteria.

It is web-based Forex strategy tester, which makes it extremely fast, probably the fastest one you can find. If you leave the generator working for 10 hours it will generate over half a million strategies.

So if I open the Forex strategy tester and click on any strategy randomly in my collection you will see that with the backtest output I have the R-squared:

Forex strategy tester
Backtest output

And actually the backtest output you can now change it and you can select which criteria to use from tools-settings and here are the backtest output metrics. So you can select which ones to see in your strategy editor. For example, the last one now at the moment is win-loss ratio and if I change it to the minimum count of trades and I go back to the strategy you will see that I have here count of trades 333. So you can select now which backtest outputs to have over here.

The R-squared is a new parameter in the Forex strategy tester that is related to the equity line.

When we use the Forex strategy tester EA Studio we have different backtest output. Such as Min Count of Trades, Maximum consecutive losses, Win/Loss ratio, and many others. These criteria help us to identify which trading strategy is better than the other one, and which one we want to use in trading.

When we run the generator in EA Studio, we see some strategies with equity lines, and it will take you a long time working with EA Studio to recognize which are the good strategies only from the equity line. With the Forex strategy tester EA Studio you have the outputs directly shown and it makes it much easier to filter the strategies.

More, when we run the Generator we can see what backtest output we want to see as a minimum, so at the end of the generation process, we will have only the filtered strategies into the collection. This is called acceptance criteria and it works brilliantly.

Let me show you first what is R-squared and I will just Google R-squared and I will go to images and I will show you what it is. Basically, this is a regression line as a trendline.

Equity line as a regression line
Regression line

And we have different dots above and below, some are on the line some are not on the line. Here, for example, is another picture with many many points and there are many pictures over here. But we can say this is a regression line with different points above and below.

Imagine we are having such a line here on our balance chart. So our equity line will go above and below and then it will go above and there will be some points that are on this regression line, right? And here R-squared changes between 0 and 100.

This is possible to be calculated only from the Forex strategy tester EA Studio.

Zero is when our equity line doesn’t touch this regression line. If it is 100 this means that all of the points are on the regression line. Meaning that our balance chart should look like one straight line and this would be the perfect line but in our case, in trading. This will be if we have only two orders executed, right? So if we have two results obviously we will see one straight line and this will be R-squared 100. So if we have more count of traits, obviously this is impossible.

This is why if we are using the Generator.

Let me switch to the Generator of Forex strategy tester, and I go to generator settings and you see here in search past we have now the option R-squared. That’s why it is good to combine it with common settings. Minimum count of trades it should be at least 10, right, to avoid having two counts of traits for the tested period. Of course, a bigger number is better. I normally keep it to 300 minimum count of trades.

Now, having it in the Reactor allows us to generate strategies that are having better and better equity lines. So the bigger number of R-squared we have a better equity line we will have because it will be closer to this regression line. So here with this strategy, we have our R – squared of 77.35.

Let me show you how strategies look when we are having bigger R-squared. I will just bring from my next screen another reactor that I was running. And because I was using R-squared as an optimization. Combined with the out-of-sample:

Forex strategy tester as đ×optimizer
OOS and Optimizer results in great strategies

You can see here I have R-squared of 95.99, 88.09, 89.16.  Here the equity line is getting much closer to such a regression line but of course, it is not a perfect line. Which as we said is possible only if we have two points or two orders when it comes to trading. So one more time using R-squared in the Forex Strategy Tester allows us to have better equity lines

Where you can use it in EA Studio Forex strategy tester?

One thing is in generator settings. You have search best, and most common is to use it by Net Balance. There are different options but now we have R-squared as well. So no matter you are using out of sample or not if you run the generator it will look for strategies that are having better R-squared, right? No matter what the R-squared value is.

But if you want, for example, to have a predefined R-squared you can set this from the common acceptance criteria. So I will click on it, the Generator will use the common acceptance criteria. And when I go there I will add it as an acceptance criterion and I will add for example R-squared minimum of 70.

Let me just go back now to the Generator and I will press Start. And you will see that it will generate the strategies that are having minimum 70 as a value for the R-squared.

Alright and here is the first strategy from the Forex Strategy Tester:

nice results form the beginning
The first strategy is with a great equity line

So you see the balance line is really stable. It looks nice, there are no huge stagnations. The bigger the R-squared is as well we will have smaller stagnation. If you play around with the Forex strategy tester, you will see that.

We will not have these huge drown downs in the equity and you can see the more the reactor works the better strategies it shows. Because in the Generator settings we have selected “search the best method to be R-squared”.

What is a good Forex strategy?

  • R-squared of 92.64, which is very good
  • the maximum stagnation is just 13.5 percent
  • we have a huge number of count of trades

Alright, and if I click on edit I will go to this strategy. And you can have a look at the entry and exit rules for this strategy.

Now the other thing what you can do to use the Reactor.

I will stop the Generator and I will switch to the Reactor in the Forex strategy tester. Now instead of having it “search best by R-squared” I can go back to net balance which I said is most common because at the end of the day we are looking for strategies that are bringing us more profit. That’s why we want the Generator to generate our strategies that are having the most net balance.

And now as acceptors criteria here I will remove the R-squared but I will increase the minimum net profit. Let’s say I will increase it to 100, for example. And then I can use optimizer which will actually optimize the strategies according to the R-squared. So they will be generated from the Forex Strategy Tester as a search best but for net balance and then they will be optimized according to R-squared. And here you can select as well if the optimizer should use the common acceptance criteria that we have. So if I press at Start. You will see I have Generator then the strategies from the Generator are going to the optimizer:

Forex strategy tester combined
Reactor = Generator + Optimizer

There is already one strategy but I didn’t clear the collection so I cannot see which strategy was that. Let me see now the next strategy that will go into the collection. Here it is! You can see the strategy and another strategy coming up. So these strategies were generated according to the net profit and they were optimized according to the R-squared. And once again you can select this from the optimized strategy section where it says optimization if you have selected. Then the optimizer will work and the search best method will be according to R-squared if you decided.

So one more time as a conclusion

What is a Forex strategy tester?

  • software that allows us to backtest strategies for a predefined period of time
  • generates strategies over the Historical data of the selected broker
  • filters the strategies according to the chosen acceptance criteria
  • allows the trader to export the strategies with one click as Expert Advisors
  • has a detailed statistic about each strategy and it is easy to see the details
  • by using the R-squared we get strategies that are having better equity lines
  • we remove huge stagnations(the period when the strategy does not make new profits)

Trading with EA Studio Forex strategy tester is one of the only ways that you can be profitable with algorithmic trading. Many traders learn to code in order to program their strategies, and many developers learn to trade. Most of the time this does not give any results. And you do not need to do it, because it will take you years…

With EA studio you do not need to have any trading or programming experience.

It does all the job that is needed. It generates strategies, so you do not need to have any profitable strategies. And many traders realize that their strategies are not profitable when they build them with the Editor in EA Studio. Most traders start to believe in strategy after it has few profitable trades. After that when they see the losses they find different reasons and explanations, they twist and change the strategy in order to keep it profitable.

The great thing with EA Studio Forex strategy tester is that it keeps being updated. It is programmed from Forex Software LTD and these guys keep working on it all the time. All licensed members receive all updates for free for a lifetime. This increases the value of the product with the time.

The lifetime license to EA Studio allows the trader to take his time, to practice as much as he wants, to build his portfolio of Expert Advisors slowly and steady, and after that just to benefit from the work he did.

Thank you very much for reading this article and let me know if you have any questions about the R- squared or anything else about the Forex strategy tester EA Studio.

You can always write any questions to our trading forum.

Also, you can register for 14-days free trial on EA Studio from our website and try this great Forex strategy tester!

Always enjoy the trading. Cheers!