Optimization should search for settings that remain useful when market conditions change. It should not search for the most attractive historical equity curve. The goal is a stable region of acceptable results, supported by untouched data and realistic costs.
Define success before running optimization
Choose an objective that reflects how the EA should behave, not net profit alone. Maximum drawdown, trade count, average trade, profit factor, recovery profile and exposure all matter. A pass with exceptional profit but unacceptable drawdown or only a handful of trades is not a robust candidate.
Maximizing profit alone may reward excessive risk, a single favorable period or settings that trade too infrequently to evaluate.
For a short-horizon test, audit scalping data, signal timing and execution in MT4 before interpreting its performance report.
Separate development data from validation data
Divide history chronologically. Use the first segment for exploration, keep a later segment untouched for out-of-sample validation, and then observe the chosen settings on current forward demo data. Do not repeatedly inspect the validation period and tune against it; once that happens, it has quietly become part of the training set.
Test sensible parameter ranges and understand behavior.
Check the rules on a period not used for selection.
Confirm current signals, costs and execution on demo.
A practical MT4 optimization workflow
Choose parameters with a logical role
Optimize only variables that plausibly affect entries, exits or risk. Keep fixed values fixed. Testing every available input multiplies the number of combinations and the chance of discovering noise.
Use broad, meaningful ranges
Start with coarse steps and realistic limits. If only one exact value works, the system is fragile. Neighboring values should produce reasonably similar behavior.
Filter by risk and sample quality
Reject passes with unacceptable drawdown, too few trades, implausible position size or results dominated by one short period. Then compare the surviving cluster rather than ranking every pass by profit.
Lock the settings and validate
Choose the settings before opening the untouched period. Record the EA build, symbol, timeframe, spread, deposit, data dates and every input so the result can be reproduced.
Stress-test the selected region
| Test | Question | Healthy behavior |
|---|---|---|
| Neighboring inputs | Does a small parameter change break the system? | Results degrade gradually, not catastrophically. |
| Higher spread | Is the edge consumed by trading costs? | The logic remains viable under a realistic buffer. |
| Shifted dates | Does one market regime create the whole result? | Several periods contribute rather than one cluster. |
| Delayed execution | Is the strategy dependent on perfect fills? | Moderate slippage does not reverse the conclusion. |
| Lower risk | Is performance only attractive at excessive exposure? | Trade logic remains coherent at conservative sizing. |
Know when to reject an optimization
- The best pass is an isolated spike surrounded by poor results.
- Most profit comes from one trade or one short period.
- Out-of-sample drawdown expands sharply or trade behavior changes completely.
- Small increases in spread or slippage erase the edge.
- The selected lot size is incompatible with the planned account risk.
Optimization cannot prove future profitability. It can only help eliminate weak assumptions and identify settings that deserve further observation.
Count the search and hold risk treatment constant
Hypothetical grid: one parameter takes 20, 30, 40 and another takes 2, 3, 4. A full grid contains 3 × 3 = 9 combinations. More parameters multiply the search space and increase opportunities to find a lucky historical fit. A genetic search samples candidates; it should not be described as checking every combination.
Compare candidates using a consistent position-sizing rule. A higher net profit caused by larger exposure is not evidence of a better entry rule. Record trade count, drawdown, costs and concentration of returns alongside the optimization objective. Prefer a stable region of reasonable neighboring settings to one isolated peak.
Keep the chronological holdout independent
For an illustrative split, develop rules on 2020–2023, reserve 2024–2025 for a later test and begin new forward observation in 2026. These dates are an example, not a claim of tested results. Fix the selection rule before opening the reserved report. If you change parameters after reading it, that period has become part of development.
In a walk-forward process, each choice must use only data available before its evaluation window. Document the windows and selection rule, including losing candidates. Repeatedly redesigning the workflow after viewing all windows can overfit the process itself. Neither optimization nor a clean holdout guarantees future performance.
The official MT4 optimization settings explain parameter ranges and the genetic option.
Reject a high-profit candidate that fails the agreed limits
Suppose an educational selection rule requires drawdown no higher than 10% and at least 100 trades in the development sample. Candidate A returns 30% with 14% drawdown and 250 trades. Candidate B returns 14% with 7% drawdown and 140 trades. Candidate C returns 20% with 6% drawdown but only 18 trades. Under that predeclared rule, A fails the risk limit, C lacks the required sample, and B remains eligible for validation. These are invented figures, not test results or universal thresholds.
B is not a proven winner. Check neighboring inputs, costs, open exposure and the quality of the equity and drawdown evidence. A candidate can pass a numerical screen while still depending on one exceptional period or an unrealistic execution assumption.
Write down the decision, including rejected candidates, before opening the holdout. Then apply a forward-validation protocol with fixed rules and review conditions. If you redesign the filters after seeing the holdout, report the revised development process and reserve new independent evidence.
Official reference
MetaTrader describes optimization as repeated Strategy Tester passes with different inputs in its official Expert Optimization documentation.