Direct answer
In MT5, “divergence” in Expert Advisors (EAs) means the EA’s behavior or results no longer match what you expected from earlier tests or from another run. This mismatch can appear as different trade decisions, different timing, different order outcomes, or the EA reaching different internal states. “Divergence” is not a single indicator or a guaranteed warning; it is a description of disagreement between runs or between assumptions and what actually happened.
Mechanism and definition (how divergence forms)
An EA is a program that makes decisions from inputs and internal rules. Even if two EAs have the same code, divergence can start when the environment feeding the code is not identical. Common sources include:
- Different market inputs: The EA may compute values from price series such as open, high, low, close, or tick timing. If the captured data differs, the EA can compute different signals.
- Different execution details: Order placement depends on how orders are processed. Small differences in fills, timing, or costs can change positions, which then change subsequent decisions.
- Different internal state: Many EAs track variables like existing positions, stop/limit placement, or “has this condition already been met?” flags. Once state differs at any point, later behavior can diverge further.
- Different assumptions in testing vs live running: Backtesting and live operation may not use the same model for timing, spreads, slippage, or how events are sequenced.
A helpful mental model is this: divergence is often a chain reaction. A small difference in inputs or execution can push the EA into a new state, and then the remaining logic applies to that new state, producing larger differences later.
Evidence or example (what to look for)
Suppose you run the same EA twice over a similar time window:
- In run A, a condition becomes true at a certain moment, and the EA enters a position.
- In run B, the condition becomes true later, or not at all, because the computed inputs differ (for example, the price history used by the EA is not identical).
From that point, the EA’s subsequent actions can differ because the set of open positions, risk calculations, and order-management logic are now different.
Another pattern is rule confirmation drift: an EA might appear to “follow its rules” in backtests, but when you rerun it under slightly different inputs (different candles boundaries, different tick capture, different execution timing), the same rule may not trigger. If you then cherry-pick the portions that still match, the perceived alignment can increase even though the underlying mismatch remains.
Limitations and risks (what divergence does not tell you)
Divergence is informative, but it does not automatically mean the EA is “wrong” or that it will fail. Key limitations include:
- No guarantee of direction: Divergence can happen both when outcomes get better and when they get worse.
- Hindsight bias: After observing results, people tend to focus on the explanation that fits the outcome. For example, they may attribute a match to “correct logic” while ignoring how small input differences could also explain mismatches.
- Variable market and account conditions: EAs depend on spreads, commissions, execution timing, and account state. Even if you control the code, these factors can still differ.
- Different test methodology: A backtest can use simplifying assumptions. If those assumptions do not match the real event sequence, divergence between test and real behavior can be expected.
Material failure modes often involve state mismatches (the EA believes it is managing a position that is not actually present) and event-order sensitivity (logic that depends on exact timing of updates). Both can produce divergence that grows over time.
Verification and next question (how to check independently)
To verify what “divergence” means in your specific case, focus on controlling variables rather than judging results after the fact:
- Compare inputs used by the EA across runs (same symbol, same timeframe, same historical data source, same session timing).
- Check for environment differences that affect event sequence (data feed, tick frequency, order processing differences).
- Inspect internal state changes at the first point where runs stop matching (for example, when a condition first triggered differently).
- Re-run with one change at a time so you can attribute divergence to a specific factor.