Overfitting in Trading Systems: How to tell if a system is over-optimized (with practical example!)

Need More Help? Book Your FREE Strategy Session With Our Team Today!

We'll help you map out a plan to fix the problems in your trading and get you to the next level. Answer a few questions on our application and then choose a time that works for you.


It is not always easy to identify systems resulting from overfitting.

Overfitting is one of the greatest enemies of systematic traders and can occur at various stages of the development of our trading systems.

One of the general common-sense rules about overfitting states that the risk of overoptimization increases with the inclusion of many filters and conditions.

However, it is good to know that even the most basic systems can be overfitted.

An example of this is the system for Gold shown in this video, which, despite its simplicity and excellent performance, results from pure overfitting... How did we find this out?

Watch the video now and learn:
-What overfitting trading systems is all about
-An example of a straightforward but highly overfitted system
-An example of testing whether a system is overfitted

Enjoy! 😉



Hey everyone and welcome to this brand new video. One of the coaches at Unger Academy here and today I’d like to show you a very simple trading system coded using only two rules, and which contains the biggest downside related to trading systems, which is Overfitting.

Alright, so in this video, I’d like to show you how easy it is to find “seemingly” successful trading systems.

Why do I say "seemingly"?

Well, because they are the result of pure overfitting of data.

What is meant by “overfitting” in trading systems?

It means getting a trading system that adapts well to past data trends, but was found randomly and thus without applying a real profitable operational logic.

Let's look together at the results of the system that we have on the screen now.

Alright, so we are working on Gold using a 60-minute chart, and here on screen we can see a system with an excellent performance.

This system is earning about $80,000 at the moment.

The System's Results

The Equity Curve of our system is here, and is definitely positive with just a little sideways movement in this area.

If we look at the long as well as short sides, we’ll find two definitely positive Equity Curves.

The drawdown of the system is quite small.

It’s around $5-, $6-, $7,000 with only one Intraday peak exceeding $10,000. So it’s very good.

So let’s go and have a look at the performance in terms of trades.

We have an Average trade of $153 excluding commissions and slippage.

This number is okay as far as the sustainability of the system is concerned, so it could be used in live trading with this performance.

It’s also well distributed. As a matter of fact, out of 530 trades we have about half long trades and half short trades.

Both Average trades are large enough to cover the costs of both commissions as well as slippage.

And then we have an Annual Period Analysis that shows only two slightly negative years.

All the other years since 2008 have been positive.

Ok, so the question is, how was this system coded?

Well, with two very simple rules.

The Code

Here’s the system. The system involves two crosses of Moving averages, one slow and one fast, where we’ll enter long or short, respectively.

The peculiarity of this system, which has a monetary stop loss of $2,000 per contract, is that it works only in the months of June and October.

Throughout the rest of the year, it doesn’t trade at all.

This system, as I’ve already told you, is very overfitted.

Even though we only have one condition that acts as an operational filter, which is this one here, we end up filtering more than 80% of the trades.

Here, we’re actually trading only two months a year, so it’s about one-sixth of the time period.

To actually see whether or not this operational engine is convenient, that is, whether or not there’s any statistical advantage over running the moving average cross with the selected inputs, so, in our case, it’s the first 35-period Moving average and the second 25-period Moving average on a 60-minute time frame what we can do is remove this condition, this operational filter, to check its performance.

Checking the "engine"

So, let's remove this part, which simply says to close all positions if they are in any month other than June or October.

And let's remove the entry condition.

Ok, let’s compile the strategy.

And we’ll get a system that will no longer have 500 trades but 3,000 and more trades.

There you go, that's the Equity Curve. Let's now analyze the trades.

We had a little over 500, multiplied by 6 which are equal to 3000 trades.

And now we see a losing equity. And in fact, the Average trade is actually negative.

We’re getting absolutely nowhere on both the long side and short sides.

Final Thoughts

And this tells us that the system that we’ve found is simply nothing more than the result of pure randomness that allows us to achieve gains only two months a year.

Does that mean that it’s a good system? Absolutely not, because the cross of Moving averages has no reason to work better in one month rather than another.

And the ability of a systematic trader can be understood exactly from the ability to distinguish randomness from a real market edge.

That’s what we deal with here at Unger Academy.

We have a solid method for building systems that allows us to take advantage of the real peculiarities of markets.

If you’d like to learn more about this, then I recommend that you go and click on the link below. This link will take you to a page where you will find very useful resources. From there, you can sign up for a free presentation by Andrea Unger or get our best-selling book "The Unger Method" covering only the shipping costs. And also please, go and book a call with a member of our team where you’ll be able to receive a free strategy consultation.

Thank you so much for following us so far.

I invite you again to subscribe to our channel if you haven’t already, and leave us a Like to support our channel.

Thank you so much, we will see you soon with new videos and of course, some new trading insights.

Can’t wait, we’ll see you next time! Bye bye!

Need More Help? Book Your FREE Strategy Session With Our Team Today!

We'll help you map out a plan to fix the problems in your trading and get you to the next level. Answer a few questions on our application and then choose a time that works for you.

Andrea Unger

Andrea Unger

Andrea Unger here and I help retail traders to improve their trading, scientifically. I went from being a cog in the machine in a multinational company to the only 4-Time World Trading Champion in a little more than 10 years.

I've been a professional trader since 2001 and in 2008 I became World Champion using just 4 automated trading systems. 

In 2015 I founded Unger Academy, where I teach my method of developing effecting trading strategies: a scientific, replicable and universal method, based on numbers and statistics, not hunches, which led me and my students to become Champions again and again.

Now I'm here to help you learn how to develop your own strategies, autonomously. This channel will help you improve your trading, know the markets better, and apply the scientific method to financial markets.

Becoming a trader is harder than you think, but if you have passion, will, and sufficient capital, you'll learn how to code and develop effective strategies, manage risk, and diversify a portfolio of trading systems to greatly improve your chances of becoming successful.