Maximum Stagnation in an EA Backtest
Maximum stagnation in an EA backtest is the longest period during which the tested equity or balance fails to make a new high. It measures waiting time and recovery duration, which maximum drawdown depth does not show.
A strategy can have a modest drawdown but remain below its prior peak for a long time. Another can recover quickly after a deeper decline. Both facts matter to a trader deciding whether the EA's behaviour is operationally and psychologically tolerable.
What is maximum stagnation in an EA backtest?
Maximum stagnation in an EA backtest is the longest interval between an equity peak and the next higher peak. If the test ends before recovery, the open stagnation period runs from the last peak to the end of the sample.
The same idea appears under other names, including maximum time under water and longest recovery time. Check which definition a report uses before comparing two systems, because a shared label does not mean a shared calculation.
The definition must state whether it uses closed balance or mark-to-market equity. Balance stagnation ignores floating gains and losses until trades close. Equity stagnation captures open positions but depends on the sampling frequency used to mark them.
It is useful to report stagnation in more than one unit:
- Calendar duration
- Number of closed trades
- Number of active trading days
- Market sessions or bars, where relevant
Calendar time reflects the customer experience. Trade count helps distinguish a quiet strategy from one that kept trading without progress.
Is maximum stagnation the same as drawdown?
Maximum stagnation is not the same as drawdown. Drawdown measures the decline from a prior peak, while stagnation measures how long a new peak is absent.
The two can overlap, but they answer different questions. A nearly flat equity line below its high may have long stagnation and shallow drawdown. A sharp loss followed by a quick recovery may have deeper drawdown and short stagnation.
Recovery factor is also a separate metric. It compares net profit with maximum drawdown, so it is a ratio describing size, not a measure of how long recovery took.
On prop-firm accounts, depth usually remains the binding constraint, because a loss limit can end an account before any recovery arrives. The rule types differ between firms and change over time, and they can include static or trailing maximum drawdown, daily loss limits, minimum trading days and inactivity clauses, so read the firm's current terms rather than assuming a shared standard. Stagnation adds a second perspective: whether the strategy is still producing opportunities at its expected pace or has entered a regime it was not designed to handle.
How is maximum stagnation calculated?
Maximum stagnation is calculated by tracking each new high in the chosen equity series and measuring the time until a higher value occurs. The longest completed or still-open interval is the reported maximum.
A reproducible calculation should specify:
- Whether the series is balance or equity
- The sampling interval for open equity
- How fees, commission and swap are included
- Whether an equal high ends the period or only a strictly higher value
- Whether the final unrecovered period is included
- Whether deposits and withdrawals are removed, which matters when the same method is later applied to a live or forward record
Standard MetaTrader tester reports do not contain a stagnation field, so the figure has to be computed from the exported deal, trade or equity series. The MetaTrader 5 testing report help shows which statistics the platform does produce.
Do not infer the value from a compressed chart. Use timestamped data. If multiple strategies share an account, calculate both component and portfolio stagnation so one active sleeve does not hide another that has stopped contributing.
What is an acceptable stagnation period for an EA?
An acceptable stagnation period for an EA depends on its expected trade frequency, holding period, market thesis and validation history. There is no universal duration that separates a healthy strategy from a broken one.
A strategy designed for rare weekly setups naturally has longer quiet periods than an intraday system. Historical maximum stagnation is still not a promise about the future. The live decision rule needs a buffer for sampling uncertainty and should combine time with evidence such as trade count, execution quality and regime change.
Avoid choosing the threshold after seeing the current slump. Define review levels during validation and state what happens at each one, such as enhanced monitoring, new-entry suspension or full revalidation.
Why can a profitable backtest have long stagnation?
A profitable backtest can have long stagnation because gains may arrive in a small number of favourable regimes while other periods are flat or losing. The final outcome hides the path taken to get there.
Common causes include:
- A trend strategy waiting through range-bound markets
- A mean-reversion strategy struggling during persistent trends
- Session conditions changing across seasons or volatility regimes
- Costs consuming a small edge during quiet periods
- Filters reducing trade frequency more than expected
- A few clustered wins dominating the historical result
Segment the test by year, volatility, session and directional regime. If nearly all progress comes from one short episode, the strategy may be more concentrated than the summary suggests.
How much backtest history is needed to judge stagnation?
A backtest has to cover several distinct market regimes and enough independent trades before its longest quiet period means anything. A wide date range alone is not sufficient when the EA barely trades or the data omits difficult conditions.
Use the strategy's mechanism to select stress periods. A gold strategy should include different volatility and policy environments. A session breakout needs changing spreads, daylight-saving transitions and both trending and failed-breakout periods.
Keep a final untouched period. Once a stagnation threshold or filter is adjusted after viewing a window, that window becomes development data for the new version.
How should stagnation be tested out of sample?
Stagnation should be tested out of sample by freezing the EA and measuring peak-to-peak duration in periods that were not used to choose its settings. Rolling walk-forward windows show whether long recovery periods keep reappearing after each optimisation.
Platform documentation defines the modelling environment, not the research design. The MQL5 reference page on testing trading strategies describes how the MetaTrader 5 tester generates ticks and states that spread during testing is taken from historical data rather than modelled. MetaTrader 4 has its own separate Strategy Tester help, so do not assume the two behave identically. Record data source, modelling mode, spread method, commission, swap, symbol specification and the exact EA and setfile versions.
Stress the assumptions as well:
- Widen the modelled spread, where the tester and modelling mode allow a custom value
- Add plausible execution delay or slippage
- Shift the test start date
- Test nearby parameter values
- Separate long and short trades
- Remove the strongest trade cluster
If a small cost change creates a much longer stagnation period, the apparent edge may be too thin for the intended environment. Check the assumed costs against the broker conditions the account will actually trade on.
Does low trade frequency make stagnation meaningless?
Low trade frequency does not make stagnation meaningless, but it makes the estimate less precise. The report should show both elapsed time and the number of opportunities or trades observed.
Zero trades can mean the setup was genuinely absent, a filter was too strict or the code failed. Audit signal-stage counters so the researcher can see how often each condition blocked an entry. That turns silence into evidence instead of guessing.
For customers, state the expected behavioural range in plain language. Do not imply that a strategy must trade every week if its rules do not support that frequency.
When should an EA be paused because of stagnation?
An EA should be paused because of stagnation only under a predeclared governance rule supported by broader evidence. Time below a peak alone is a review trigger, not automatic proof that the strategy has failed.
Check whether the current period differs in trade frequency, average cost, signal composition, broker execution or market regime. Verify that the installed build and setfile match the validated release. A technical fault demands a different response from normal strategy variance.
The decision process can be staged:
- Verify data, connectivity, version and symbol settings.
- Compare current signals with historical regime behaviour.
- Suspend new entries if a predefined safety condition is met.
- Revalidate without fitting directly to the stagnation window.
- Resume only through a documented release decision.
Use the JPTC EA Hub as the practical next step for reviewing strategy controls, then read the published results alongside drawdown and trade frequency rather than judging any one of them alone.
Automated forex and gold trading
Runs on your own account at your own broker. We host and set it up, so there is nothing to install and no VPS. No profit share, no monthly fee.
See how it works