Looking for Best Practices in EA Refinement Before Requesting Improvements

 

Hello everyone,

I have an Expert Advisor that operates based on trend conditions; it opens trades when the market starts to move in a clear direction (based on indicators). However, during sideways or ranging periods, it tends to accumulate losses or end up in break-even situations according to my backtests.

Before opening a job request to improve this EA, I’d like to better understand what experienced developers consider good practices when refining an EA’s logic and performance. My goal is to know exactly what to ask for — avoiding requests that are either impractical or not aligned with how optimization should ideally be approached in MQL5.

Currently, the main improvement I’m considering is a lateral market filter — something capable of identifying and avoiding trades when the price is consolidating. From what I’ve researched, this type of filter is relatively common, but I’m interested in learning what kind of implementation is considered robust and efficient in real-time conditions (not just in backtests).

The second part — and the one I find most intriguing — is something I’ve seen my former instructor use. He referred to it as a “Quant” environment, which seems to be a combination of software and infrastructure beyond the standard MT5 backtesting system. From what I understood, it runs on a high-performance VPS, equipped with top-tier CPU cores that dramatically speed up backtesting and optimization cycles.

This “Quant” setup not only handles intensive computation but also tests strategies on a reliable data source (Darwinex). It performs extensive iterations across parameter combinations and produces the most profitable configuration (“sets”) for each symbol and timeframe. It also shows the developer points to be enhanced on code; things that would make the solution more profitable.

I don’t have access to that specific system, but I’d like to explore how something similar could be applied. Or, thinking on a good hypothesis, find someone with the exactly technology that I could hire. For that, I'd need the name of it.

So, my questions are:

1 - What do you consider best practices when refining or optimizing an existing EA?

2- When it comes to filtering out non-trending periods, what’s the best approach to make it both lightweight and reliable?

3- For large-scale optimization or “Quant-like” testing, are there tools, frameworks, techniques etc. that I could hire?

And finally, based on your experience, what would be a reasonable cost or time estimate for implementing these improvements — both the lateral market filter and the advanced optimization structure?

Any guidance, references, or examples from experienced programmers would be extremely valuable before I move forward with development requests.

Thanks in advance for your insights,


— Marcelo

 
  1. A good EA having solid strategy logic should only need minimal optimization, if any. Best practice is not to engage in overfitting to a particular short-term data set--which can be irrelevant to real world trading.
  2. Standard deviation, ATR, daily range, and/or ADR can be used to filter based on volatility.*  Alternatively, custom Renko charts don't print price by time but only by movement--which tends to eliminate sideways action.
  3. Linking external quant-like utilities to MT5 seems to be a bit pointless to me. Quants typically engage in HFT and MT5 isn't designed for HFT.
* For an example of programmatic implementation of standard deviation combined with ATR and moving averages, see:

Code Base

Brooky Trend Strength for MT5

Ryan L Johnson, 2025.04.29 19:52

This indicator calls 3 other subwindow indicators. All files go in your Indicators folder.

 

Stop using Ai we know you used it because — isn't even a key on your keyboard and I never saw anyone use this character in my life until chatGPT rolled out. 

Best practice to me means to always check error codes. As for strategy creation its more important to have your strategy's underlying premise fit the narrative of what you are targeting. For some reason the human brain is inclined to think that you can just slap five or six indicators together and click optimize and get some magically profitable (overfitted) EA. My simple systems that only use a single indicator have always been more profitable than anything complicated that I've tried. Another thing is to match the type of system to the asset. I keep trend following to gold, nasdaq, and s&p while only running mean reversion and grid on forex pairs. 

You should also test on different data sources just to make sure you didn't overfit on accident. Also you should consider if you need real tick data or 1 min ohlc data. I personally code all my trend following strategies to only react on new 1 min bars and I adjust the stop accordingly. This will keep you out of a lot of chop that just isn't there with real tick data. However for a grid EA I would consider using tick data instead and for anything that generally holds trades for a longer time period I will use 1 min ohlc, but you have to code everything inside the EA to only react on new 1 min bars and all the caveats that come with it. 

You should also be deathly afraid of overfitting and do everything in your power to avoid it if you plan on optimizing. I don't optimize more than 3 parameters unless the 4th is something related to like a news filter or something. I do not think regularization fixes higher degrees of freedom leading to overfitting for trading systems specifically, just aim for higher sample size. Also there isn't really a point in connecting mt5 to other platforms you should be using the platform you plan on executing trades on, why make it overcomplicated? Also VPSs typically don't like it when you blast their servers with giant optimizations so whatever you are talking about in your post is probably too expensive to be worth it for you right now. 

 
@Csquared #Stop using Ai we know you used it because — isn't even a key on your keyboard and I never saw anyone use this character in my life until chatGPT rolled out

I agree that the initial post does seem AI generated, but in this case, it is probable that the OP used it for translation from an original Brazilian Portuguese text.

However, just because the em-dash "—" character is not available on the US keyboard, does not mean it's not commonplace or inaccessible. I personally use the character quite often and I don't use AI. I also often use curly quotes or a curly apostrophe too. When preparing a longer post, I often first write it up in an editor or word processer, where curly quotes or apostrophe are automatically generated from normal keyboard quotes, and the em-dash can just as easily be created on many editors (e.g. Ctrl+Alt+Minus on Word).
 
Fernando Carreiro #:

I agree that the initial post does seem AI generated, but in this case, it is probable that the OP used it for translation from an original Brazilian Portuguese text.

However, just because the em-dash "—" character is not available on the US keyboard, does not mean it's not commonplace or inaccessible. I personally use the character quite often and I don't use AI. I also often use curly quotes or a curly apostrophe too. When preparing a longer post, I often first write it up in an editor or word processer, where curly quotes or apostrophe are automatically generated from normal keyboard quotes, and the em-dash can just as easily be created on many editors (e.g. Ctrl+Alt+Minus on Word).
Oh my bad lol, I'm just tired of talking to regular english speaking people and getting hit with the em-dash 40 times in one paragraph. 
 

It can also be entered with Windows tool — I used ONLY the keyboard :


 
Alain Verleyen #:

It can also be entered with Windows tool — I used ONLY the keyboard :


That's only in Windows 11 to be precise.

@Csquared, well said in Post #2. One indicator can have a unique or conglomerate calculation in it. Analyzing a half dozen indicators can be as confusing as analyzing a half dozen timeframes, and a Renko chart is basically a timeless grid without horizontal lines on the chart.

 
Ryan L Johnson #:

That's only in Windows 11 to be precise.

Nope. My screenshot is from Windows 11 but it works on Windows 10 too.

 
@Ryan L Johnson #That's only in Windows 11 to be precise.

Windows 10 too ... Windows key + . (period)

 
@Ryan L Johnson #:  ... and a Renko chart is basically a timeless grid without horizontal lines on the chart.

You keep hailing Renko as a "miracle", but it is only as good as the size that you set for it. Selecting a size can be just as arbitrary as selecting the period of a moving average.

It requires just as much (if not more) optimisation passes to find the best fit and is highly symbol (and broker) dependant and can shift over time.

It is not a "miracle" solution that fits all. Like all methods and strategies, it requires the right market conditions and just the right brick size for it to be any good.

It is simply only one of the many, many methods—no better, no worse!

 
Alain Verleyen #:

Nope. My screenshot is from Windows 11 but it works on Windows 10 too.

Fernando Carreiro #:

Windows 10 too ... Windows key + . (period)

Wow, it works in Windows 10 too! Thank you, both. It's obvious that I have non-correctable vision problems.😂