MetaTrader ./wikiINDEPENDENT ENCYCLOPEDIA · N#1 SOURCE EST. 2010SECTOR INTELLIGENCE & ADVANCED MARKET ANATOMY

Strategies · Technology · Risk Assessment

Expert Advisors: technology, strategies and due diligence

Understand automated rules, make grid risks visible and test performance promises.

01.10.2026Analysis and interactive strategy laboratoryIndependent of MetaQuotes
On this pageA trading rule becomes executable software.EA types: decisions, execution and risk logic.From the event to the confirmed execution.Strategy lab: a better average entry price comes at a cost.Develop an EA: first specification, then code.Backtest, track record and robust questions.Blackbox: information gap, no automatic fraud allegation.Strengths, weaknesses and sales logic.EA-Scam: Investigating promise, access and money flow.Three related perspectives: behaviour, stress and replication.Sources and limits of the evidence.

A trading rule becomes executable software.

An Expert Advisor (EA) is a program for the desktop environment of MetaTrader. It processes events and can send trade requests. The word “expert” describes a program category, not a tested professional competence. Automation makes a decision repeatable; it does not automatically make it economically viable.

An indicator calculates and visualizes information. A script typically completes a task once started. An EA can continuously respond to events. A signal service transfers external decisions; the EA implements locally programmed rules. Combinations are possible. The technical implementation, risk responsibility and business model must be considered separately.

Three questions before each release: What does the software decide? How much risk can she take? What evidence supports the claimed performance?

The EA file runs in the desktop terminal or a suitable hosting environment. The mobile app is not a local MQL runtime for your EX4/EX5 file. A computer switched on alone is not enough: terminal, connection, trading rights, account status and strategy conditions must fit together. See also Installation, permissions and controlled shutdown.

EA types: decisions, execution and risk logic.

FamilyPrinciplesTypical test point
Trend sequenceEntry in sustained direction; exit in case of rule break.False signals and costs in sideways phases.
Mean ReversionPosition against a suspected exaggeration.What happens when the deviation becomes structural?
Breakout/momentumTrading after breakout or acceleration.Gap, spread and execution at signal time.
ScalpingSmall target movements and short holding time.Cost per envelope, latency and fill assumptions.
GridMultiple entries by price intervals.Total exposure instead of isolated single heading.
Martingale / Loss ProgressionPosition size increases after losses or counter movements.Capital requirements, finite limits and rare large losses.
Execution and risk assistantPartial orders, stops, position sizes or alarm rules.No stand-alone return strategy is required.
Portfolio / statistical modelsSignals via instruments, relationships or models.Correlation, data reconciliation and regime change.

These families overlap. A grid does not have to use a martingale. “AI”, “hedging” or “arbitrage” are not sufficient strategy description without entry and exit rules. A counterpart can increase gross exposure, costs and margin, although net exposure decreases.

From the event to the confirmed execution.

  1. Event: Initialization, tick, timer or trading transaction activates the appropriate function.
  2. Condition: Program reads prices, time, symbols, own positions and account limits.
  3. Rule: A signal is calculated. Data must have been actually available for decision.
  4. Risk assessment: Exposure, allowed size, spread, free margin and existing requests are reviewed.
  5. Question: An order is sent to the trading server.
  6. Reaction: Rejection, acceptance, partial filling and actual deals change the state. Protocol and account reconciliation close the circle.

In MQL5, these include among others OnInit, OnTick, OnTimer and OnTradeTransaction. OnTick refers to the chart symbol. Events are processed sequentially; another NewTick is not added if one is already waiting or being processed. „Every tick is traded is therefore not a safe assumption. Deactivated auto trading prohibits trade requests, but does not automatically stop event processing. [1]

A positive result of OrderSend() Not only does it confirm the deal that has been concluded. Return codes and trade transactions must be evaluated. Repeated requests for Timeout without account verification can generate duplicate actions. An EA needs a comprehensible treatment of rejections, restarts and already existing positions. [2]

MT5 supports account netting or hedging. A strategy that expects separate counterparts must check the account properties. Symbol names, contract size, volume step and stops are not universal constants. Symbol specifications and Order path and brokerage risk Explain these limits.

Strategy lab: a better average entry price comes at a cost.

Compare a grid with constant sizes and a doubling. Both buy after falling courses. The weighted entry approaches the market; at the same time, the position grows. Recovery is a scenario, not a promise.

Abstract long model in monetary units: start bid 100, constant spread 0.20, 1 unit = 1 money per price movement. Margin = current positive nominal value / leverage. No commission, financing or real broker execution. In the gap, only the observed ask is repurchased, at most once per step. Stop-out closes the entire basket at the first observed margin level below 50%; real rules and losses may differ.

Read Balance and Equity together. Open losses do not disappear because the EA has not yet realized them. Several small closed profits can exist alongside a large open loss. The order of market movements determines which additional positions and capital limits are reached at all.

Develop an EA: first specification, then code.

MQL4 and MQL5 are the platform specific programming languages. Their syntax is C++-like; trading model, libraries and interfaces differ. MQ4/MQ5 are source files, EX4/EX5 compiled programs. A file becomes incompatible by renaming. Porting requires professional and technical examination. [3]

  1. Rules in writing: Instrument, time level, data level, entry, exit, cost, maximum loss and behavior on open trades after restart.
  2. Risk independent limitation: define the maximum number of units, overall position, daily loss and emergency shutdown before signal optimization.
  3. Implementation in MetaEditor: Keep events, signal, execution and logging separate. The wizard can produce scaffolding; it does not replace the strategy check. [4]
  4. Check error cases: invalid volume, missing data, trading pause, high spread, disconnection, double request and parameter change.
  5. Historically test: Archive comprehensible data, costs, test mode, version and parameters.
  6. Untouched data and demo: Test only after the rules have been established. Explain live deviations with the test instead of making the test suitable afterwards.
  7. Controlled release: Establish responsibility, monitoring, change protocol and take-back plan.
Ereignis empfangen
Kontozustand und offene Anfragen abgleichen
wenn Daten unvollständig oder Risikogrenze erreicht: keine neue Anfrage
Signal mit bekannten Daten berechnen
zulässige Größe und Handelsbedingungen prüfen
Anfrage senden und Ergebnis protokollieren
spätere Transaktionen mit dem erwarteten Zustand abgleichen

This pseudo-model is an architectural aid, not a tradable robot. The Guidance for the strategy testerBacktests and Track Records Leads through the platform functions. A compiled program without errors can still execute a lossy rule.

Backtest, track record and robust questions.

The MT5 tester offers different tick models, optimization and a forward range. Cost and execution assumptions influence the outcome; a historical test is not a reconstruction of any future execution. Also check if special test modes hide costs. [5]

EvidenceWhat he can showWhat is missing in addition
BacktestBehavior of a version under chosen historical assumptions.Independent data, execution realism, selection process.
Uncontacted test sectionResult outside the original calibration.Was the section used for optimization after sighting?
Demo forwardRuntime, signals and program errors in ongoing operation.Real fills and real costs.
Live statement of accountObserved transactions of this account.Completeness, open losses, other accounts, strategy version.

Request equity history, maximum open position, deposits and withdrawals, holding period, costs, loss streaks, and the worst open drawdown. A balance curve alone is not enough. Winrate says little without profit/loss measures: 90 wins of 1 each and 10 losses of 12 each result in −30 before costs.

Overfitting: Many variants are tried out and only the best is presented. Look-ahead: Later information enters the earlier decision. Survivorship: Failed accounts or variants are missing. regime dependency: The rule fits a market section and fails under other conditions. A perfect curve requires better evidence, not fewer questions.

Blackbox: information gap, no automatic fraud allegation.

With a compiled third-party EA, the source code is often hidden. This may be for legitimate protection of intellectual property. For the user, however, a test limit remains: hidden progression, external dependencies, changed rules and misconduct can be judged more difficult. Visible code only helps if it is technically checked and belongs to the binary file actually used.

Request a written strategy description, size caps, loss handling, version history, permissions, data transfers, and behavior in case of license or connection errors. Use separate test environments. DLL and WebRequest rights must be granted consciously; they open additional interfaces. Access data, remote access and transfers do not belong unchecked in a software purchase.

An Important Limit: The Rules of MQL5 Market require compiled products and, among other things, prohibit DLL calls. They prohibit return guarantees and the presentation of backtests as real trading. The platform describes its audit as formal and does not guarantee profitability or error-free operation. These rules apply to market distribution, not flat-rate for each externally sold EA. A marketplace listing is not an independent economic due diligence. [6]

Strengths, weaknesses and sales logic.

StarchCorresponding limit
Repeatable rulesA systematic error is also repeated.
Disciplined executionAn inappropriate parameter remains disciplined inappropriate.
Rapid processingBroker, network and event queue limit execution.
Historically InvestigableA selected curve can hide selection distortions.
Multiple markets can be monitoredCorrelation and common causes of failure remain.

A provider can earn on sales, subscription, hosting or brokered trading volume. These revenues can also arise if the customer’s strategy loses. Frequent trading increases the cost envelope under otherwise identical conditions. Therefore, ask about compensation and brokerage retention as well as results for all costs.

Grid and Martingale deserve special attention: the market can run against the basket longer than capital is available. A finite doubling sequence with starting size 1 results in 31 units after five entries. A position limit ends size growth, but does not eliminate the loss of existing positions. “Close no losses” is not a loss avoidance.

An EA sale is not automatically portfolio management. In addition, if individual advice is provided, the account is controlled or a decision is taken for the customer, the activity, responsibility and possible permission requirements must be examined separately. Copy Trading and Regulatory Roles and Law and consumer protection Arrange these questions.

EA-Scam: Investigating promise, access and money flow.

The CFTC explicitly warns against the marketing of bots and AI as money machines. The technical designation does not provide evidence of certain or exceptional profits. [7] Warning signs include guaranteed return, secret risk-free strategies, pressure to deposit, subsequent unlocking fees, and refusal to provide full account details or the contracting party.

Distinguish four cases: An honest strategy can lose. A developer can make mistakes. A seller can misleadingly conceal risks. A fraudulent model can only use software as a pretext for making deposits. A loss alone does not prove the last case; a beautiful curve does not refute it either.

Audit trail: Determine identity and party → Disclose remuneration and broker relationship → Require full performance data → Limit permissions → Test independently. In case of anomalies, save version, files, parameters, journal, account statements, communication and payments. Critically question further payments for the alleged “rescue”. Documentation and consumer protection Provides follow-up knowledge.

Three related perspectives: behaviour, stress and replication.

For our other content architecture, ECS, TFF and copytrader.io stand for three additional audit perspectives. No already implemented data connection or product certification is claimed here.

TFF · What was actually traded?

Consider trade-by-trade: size progression, follow-up purchases, basket exits, holding period and risk concentration. Compare the claimed strategy with observable behavior.

See Tradeflow Forensics ↗

ECS · What stress can the account withstand?

Examine alternative sequences, longer loss phases and changing costs. The lab above shows the basic idea; scenarios are not probabilities of occurrence.

To the strategy laboratory

copytrader.io · What reaches the follower account?

Separate signal generator result and follower result. Size, leverage, minimum volume, time delay and cost can change the transmission.

view copytrader.io ↗ · Copy-trading knowledge

Sources and limits of the evidence.

Checked on 01.10.2026. Manufacturer documentation describes technical functions and our own distribution rules; the evaluation of strategy risks is our analytical classification. The laboratory is a transparent computational model with no market data and no yield forecast.

  1. MQL5: OnTick and Event Queue · Event functions
  2. MQL5: OrderSend and execution feedback
  3. MQL4 Language Basics · MQL5 Language Basics
  4. MT5: Creating EAs · Terminal rights and settings
  5. MT5: Strategy Tester
  6. Rules of the MQL5 Market
  7. CFTC: AI Won’t Turn Trading Bots into Money Machines

What proves a good result?

Check backtests, track records and typical fallacies