How long of backtesting is ideal for an EA?

Hello everyone,

So I recently took a course about a month ago on how to optimize MT4 / MT5 bots and the author of the series always said to use 3 months backtest, 1 month forward test. Now to me, that didn’t seem like enough. But then I see others that claim that more than 2 or 3 years is needed for backtesting. But in my experience, everytime I do this, the best forward test had the absolute worst backtest results. The only way to really get an average profit is to use the parameters that just did average in both the backtest and forward test so that at least you can rest easy knowing that its at least half-optimized for past market conditions and half-optimized for future and get the best of both worlds. I think its impossible to optimize a robot to trade in an uptrend, downtrend, ranging, or volatile markets all at the same time.

Now I’m thinking, maybe the author was right. I should be optimizing bots for current market conditions only, and re-optimize every 3 months, instead of trying to find the “ultimate” parameters for the last 10 years because this never works. Especially when I see some bot authors posting pictures of robots that earned billions of dollars in 10 years :smiley: :smiley:

So maybe I’ll do 3 months of backtest and 3 months of forward test just to have a good picture of the current market.

What are your thoughts?

Nice Backtest not make sure right in future. Anyway longer backtest is better.

Yes very true, I can agree with you. Also I will suggest that after 3 good consecutive month, you have to re-optimize your EA setting again, so it can adapt to a new market.

Sort of depends upon the time frame on which you are running your EA.

If your strategy works on D1 bars, and you only get 1 or 2 signals a week, then 3 months would not give enough data points for statistical significance. Even 2 years might not be long enough to give you enough trades for statistical significance.

I do not understand why everyone is talking about ‘re-optimizing’ the EA for the current market…

That means, that the behaviour of a market changes every 3 months… That would be strange.

Isn’t an EA made to work in any market conditions, in a robust manner?!

If not, then what is the clue about coding EAs? - Does it make sense?

PS: What you can truly do is to at least enable news filter in forward test, so that extreme market movements by high impact news get filtered. This is something you cannot turn on in backtests.

Isn’t an EA made to work in any market conditions, in a robust manner?!

Yes and No, hm ?! This would be a holy grail literally interpreted. I see that there is a cycle of 2 years where commercial expert advisors need reprogramming or adapting in coding to ensure initial strategy. Up to this point changing of parameters can adapt to market situation. Some provide automated parameter update transmission, some provide new set files to load. Often changed SL, TP, Moving average values and so on.

I also watch some strategies not to survive, they just work in situations that change, example global change from ranging to trend, change in night volatility. You can get millionaire on catching one of those expert advisors that match the current situation, but if situation changes after a month, 6 months a year it will fail. This is why I prefer expert advisors with moderate results. High monthly profitability (50%, 100%,) is not possible then by filter to avoid times where it would fail or someone interfears manually to avoid this. Some commercial expert advisors will not make profit for 3 months or a year and then start to make a lot of profit. After two years results are in average fine. I think they have heavy filters build in and often fail in between (small profits and small losses). This is about regular expert advisors not algorithms as pure Martingale of course. Those might survive for years, then fail. Saving of deposits is a good idea for high profit expert advisors. For me 5, 10 or 20 % a month is very fine if strategy can survive for years

Agreed. I’ve only been using MT5 for maybe 2 months and thankfully I’m skeptical about 90% of the EA’s I’ve seen that have near-impossible results. So far I’ve only purchased 2 EA’s that look promising to me but I have backtested at least 20 of them many dozens of times. its so easy to think that the authors results are the same as the ones you will get. But that\s never the case. I especially stay away from EA’s with 20 parameters or more. I just think that’s way too complicated and it makes backtesting take a week per test, and I have 3 computers! Each with 8 cores, so 24 agents at 4.0ghz :slight_smile:

I do forward testing in a different way: Set a parameter for the start date of an EA to get active, and move that start day forward one day, than one more day etc… Do that for like 365 days and let the EA run till today. That way you run your EA always under different entry price conditions and gets different results. A good EA should survive this, even if the final profit will fluctuate quite a lot, but should never be negative.