Expert Advisor Development

Home Software Solutions Expert Advisor Development

Overview

An Expert Advisor is only as good as the code behind it. The MetaTrader platform gives traders the infrastructure to automate their strategies — but the quality of the automation depends entirely on how well the EA is written. A poorly constructed EA misses entries, mishandles positions, behaves differently in the strategy tester than it does live, fails silently when the broker connection drops, and produces results that bear no relationship to what the strategy was supposed to do.

We write Expert Advisors professionally. That means understanding the MQL4 and MQL5 execution models deeply enough to avoid the pitfalls that trip up amateur EA development, testing rigorously enough to trust the results, and building EA architecture that is maintainable and extensible as strategies evolve. Whether you have a strategy that needs to be coded, an existing EA that needs to be fixed or extended, or a complex multi-symbol system that needs to be built from scratch — we deliver EAs that work correctly in live trading, not just in the tester.


MQL4 vs MQL5 — Choosing the Right Platform

The choice between MQL4 and MQL5 is not always obvious and depends on several factors specific to your situation.

MQL4 is the language of MetaTrader 4 — the platform that still dominates retail forex trading. The MQL4 execution model is simpler and more predictable for straightforward single-symbol strategies. The broker infrastructure for MT4 is mature and widely available. For strategies that run on a single symbol and timeframe, for traders whose brokers only offer MT4, and for migrating existing MT4 EAs with minimal friction, MQL4 remains the right choice.

MQL5 is the language of MetaTrader 5 and is where the MetaQuotes roadmap is focused. MQL5 is a proper object-oriented language with a richer type system, better performance characteristics, access to the MetaTrader 5 Strategy Tester's multi-threaded optimisation, support for multiple position types including hedging and netting account modes, and access to a broader range of markets beyond forex including stocks, futures, and options. For new EA development where MT5 broker access is available, MQL5 is the forward-looking choice.

We develop in both. For existing MT4 deployments we work in MQL4. For new development we recommend MQL5 where the broker and account type support it. We also handle MQL4 to MQL5 migration — rewriting existing MT4 EAs in MQL5 with full logic preservation and adaptation to the MT5 execution model.


What We Build

Full Strategy Implementation The most common engagement is translating a trading strategy — one that a trader has been executing manually or that exists as a concept, a set of rules, or a partially working EA — into a complete, production-ready Expert Advisor.

We start by understanding the strategy completely. Entry conditions, exit conditions, position sizing logic, risk management rules, the instruments it trades, the timeframes it operates on, and the edge cases and exceptions that the strategy needs to handle. Ambiguities in the strategy specification are resolved before coding begins — not discovered mid-implementation when fixing them requires rebuilding what was already written.

The implementation covers the full lifecycle of a trade within the EA:

Signal generation from indicators, price action conditions, time-based filters, or any other input the strategy uses. Order management covering entry execution, scaling in, partial close, stop loss placement, take profit placement, trailing stops, and break-even logic. Position monitoring that tracks open positions correctly across broker reconnections, terminal restarts, and the edge cases that live trading produces. Risk management enforcement that limits exposure at the trade, session, and account level according to the strategy's rules. Logging and diagnostics that record every decision the EA makes with enough context to understand its behaviour and debug problems.

Custom Indicator Development Strategies that depend on indicators not available in the standard MetaTrader library require custom indicator development. We write custom indicators in MQL4 and MQL5 that implement technical analysis calculations correctly — with attention to the buffer management, drawing properties, and calculation efficiency that separates professional indicator code from amateur implementations.

Custom indicators we have written include multi-timeframe indicator wrappers that expose higher timeframe indicator values on lower timeframe charts, composite indicators that combine multiple standard calculations into a single output, market structure indicators that identify swing points, support and resistance levels, and trend structure, and volatility-based indicators used for dynamic stop placement and position sizing.

Multi-Symbol and Multi-Timeframe EAs Strategies that operate across multiple symbols simultaneously, or that use multiple timeframe analysis within a single EA, require careful architecture to handle correctly in MQL. The approach to multi-symbol operation differs between MT4 and MT5, and the correct handling of multi-timeframe data — avoiding look-ahead bias in live trading while maintaining the same logic that was tested in the strategy tester — requires explicit attention.

We build multi-symbol EAs that manage positions across a portfolio of instruments simultaneously, with correct position tracking per symbol, risk management applied at the portfolio level, and execution logic that handles the different price, spread, and liquidity characteristics of different instruments correctly.

Risk Management Modules Risk management is not an afterthought in a professional EA — it is a core component that determines whether the strategy survives adverse conditions. We build risk management modules that enforce:

Lot sizing based on account equity or balance with configurable risk percentage per trade. Maximum simultaneous positions at the instrument, strategy, and account level. Daily loss limits that halt trading when a defined loss threshold is reached for the session. Drawdown-based trading halts that suspend the EA when account drawdown exceeds a defined threshold. Spread filters that prevent entry when broker spread exceeds a defined maximum — essential for strategies where spread represents a significant fraction of expected profit. Time filters that restrict trading to specific sessions, days, or market conditions.

EA Portfolios and Master Controllers For traders running multiple EAs simultaneously, coordination between them becomes necessary — ensuring that combined exposure across all running EAs stays within overall risk limits, that EAs do not open conflicting positions on the same instrument, and that a single controlling interface provides visibility across the full portfolio. We build master controller EAs that coordinate across a portfolio of strategy EAs running on the same terminal.


The MQL Execution Model — Why It Matters

Writing EAs that work correctly in live trading requires understanding the MQL execution model at a level deeper than most EA tutorials cover. The issues that cause professionally-looking EAs to fail in live trading are almost always rooted in misunderstanding how the platform actually executes code:

OnTick vs OnBar execution. EAs that are written assuming they execute once per bar behave correctly in the strategy tester but produce incorrect results in live trading when ticks arrive between bar opens. We write EAs with explicit bar detection logic where bar-based execution is required, and use OnTick correctly for strategies that need to respond to every price update.

Order state management across reconnections. An EA that tracks open orders using in-memory variables loses that tracking when the terminal reconnects after a network interruption. We manage order state by querying the broker's order book on every tick rather than relying on in-memory state that can become stale.

Broker-specific behaviour. Different brokers handle order execution, requotes, partial fills, and minimum stop distances differently. EAs that assume uniform broker behaviour fail on brokers that deviate from the assumed model. We write broker-agnostic EAs that handle the range of broker behaviours encountered in live deployment.

Strategy tester vs live discrepancies. The strategy tester makes assumptions — about fill prices, about the order of events within a bar, about spread — that do not hold in live trading. We design EAs that minimise the gap between tester and live behaviour, and we validate that gap explicitly through forward testing before deploying capital.

Error handling. Every order operation in MQL can fail. Requotes, context busy errors, invalid stops, and broker-side rejections all produce error codes that need to be handled explicitly. EAs that do not handle errors correctly either fail to enter positions during fast markets or accumulate ghost positions when close orders are rejected silently.


Strategy Tester and Optimisation

The MetaTrader Strategy Tester is the primary tool for validating EA behaviour before deploying capital. Using it correctly — extracting results that are predictive of live performance rather than just a good-looking backtest — requires understanding both its capabilities and its limitations.

Backtesting methodology. We run backtests on high-quality tick data rather than OHLCV bars, which eliminates the within-bar order ambiguity that bar-based testing introduces. We model realistic spread conditions rather than fixed spread that underestimates real trading costs. We use data that covers multiple market regimes — trending, ranging, high volatility, low volatility — rather than cherry-picking periods where the strategy performs well.

Optimisation without overfitting. Strategy Tester optimisation finds the parameter values that maximise performance on historical data. Without safeguards, this produces strategies that are optimally fitted to past data and perform poorly going forward. We apply optimisation with explicit overfitting protection — out-of-sample validation splits that test optimised parameters on data that was not used in optimisation, stability analysis that identifies parameter regions where performance is robust rather than dependent on precise parameter values, and walk-forward testing that validates parameter stability across time.

Forward testing. Before deploying an EA to a live account, we run it on a demo account for a statistically meaningful period — long enough to observe the strategy's behaviour across different market conditions, to identify discrepancies between tester and live execution, and to build confidence that the EA is behaving as intended. We instrument forward testing with detailed logging so that every decision the EA makes can be reviewed and validated against the intended strategy logic.

Performance metrics we analyse. Raw profit is the least informative performance metric. We analyse risk-adjusted return metrics — Sharpe ratio, Sortino ratio, Calmar ratio — alongside maximum drawdown, drawdown duration, win rate, profit factor, average win/loss ratio, expectancy per trade, and trade frequency. We look for performance profiles that are consistent across different time periods and market conditions, not just impressive overall numbers driven by a small number of exceptional trades.


EA Audit and Debugging

We also work with traders who have existing EAs that are not performing as expected — producing different results than the backtest predicted, entering positions at unexpected times, failing silently in certain market conditions, or behaving inconsistently across different brokers.

EA debugging requires systematic analysis of the EA's logic against its actual behaviour in live or forward testing conditions. We review the code for known MQL pitfalls, analyse the EA's log output to identify the decisions it is making and why, compare live execution against tester execution to identify the sources of discrepancy, and produce a clear diagnosis of what is wrong and what needs to be changed to fix it.

Common issues we find in EA audits include incorrect handling of the strategy tester's modelling mode in live conditions, order management logic that does not account for partial fills or requotes, indicator calculations that introduce look-ahead bias, position sizing logic that produces incorrect lot sizes for non-standard account currencies, and error handling that masks failures rather than surfacing them.


Technologies and Tools

  • MQL4 — Expert Advisor and custom indicator development for MetaTrader 4
  • MQL5 — Expert Advisor and custom indicator development for MetaTrader 5, object-oriented EA architecture
  • MetaTrader Strategy Tester — backtesting, optimisation, and forward testing
  • MetaEditor — MQL development environment, debugging, profiling
  • Tick data — high-quality historical tick data for accurate backtesting
  • MQL4 to MQL5 migration — complete logic-preserving rewrites for platform migration

What Good EA Development Looks Like

A professionally developed EA is not just code that runs — it is code that can be understood, maintained, and extended. Every EA we deliver includes:

Clean, commented code. The logic of the strategy is clear from reading the code. Functions are named for what they do. Complex logic is explained with comments. The person maintaining the EA six months after delivery can understand what it does and why without reverse-engineering it.

Comprehensive logging. Every signal evaluated, every order placed, every risk check applied, every error encountered — logged with timestamp, price context, and the values of relevant variables. When something unexpected happens in live trading, the logs tell you exactly what the EA was thinking.

Configuration via input parameters. Every variable that might need adjustment — risk percentage, lot size, stop loss distance, take profit distance, indicator periods, time filters — is exposed as an input parameter that can be adjusted without recompiling the EA. Hard-coded values that should be configurable are a maintenance problem.

Documentation. A written explanation of what the EA does, what each input parameter controls, what the EA's dependencies are (broker requirements, minimum account size, required symbols and timeframes), and how to deploy and monitor it.


Ready to Automate Your Strategy?

Whether you are starting from a manual trading strategy that you want to automate, an existing EA that needs professional reconstruction, or a complex multi-symbol system that needs to be built from the ground up — we have the MQL expertise to deliver it correctly.