EA 検証

EA Over-Optimization and Curve Fitting: What to Check Before Trusting Backtest Results

2026-09-01  / Ya

An EA that posts a PF of 2.5 and an annualized return of over 200% in backtesting can cut a live account in half within weeks. The single biggest cause of that gap is “over-optimization (curve fitting).” This article covers the definition of over-optimization, how it occurs, how to detect it numerically using the OOS ratio and walk-forward analysis, and the traps that beginners most commonly fall into.

Definition / Mechanism

Over-optimization is the phenomenon where an EA’s parameters (moving average periods, take-profit levels, stop-loss levels, etc.) are repeatedly adjusted to fit historical data, resulting in a model that conforms only to that specific past period. In statistics this is known as “overfitting.”

Breaking down how curve fitting occurs:

  1. The developer runs a batch search across hundreds to tens of thousands of parameter combinations in a tool such as Strategy Tester
  2. The combination with the highest PF (Profit Factor) and lowest maximum drawdown is adopted as-is
  3. Because the resulting EA has been tuned to reproduce even the “price noise” of that specific period, it fails to work in future market conditions

Statistically, the more parameters are adjusted, the more “degrees of freedom” are lost. The model gains a better fit to the training data while losing its ability to generalize to real future price movements. With ten parameters, a perfect fit can be achieved with as few as ten data samples.

Running “multiple optimization cycles” itself makes the problem worse. If you optimize once, then make adjustments and re-test and re-adjust using the same data, the validation dataset effectively becomes training data, and generalization performance approaches zero.

Concrete Example / Formulas / Tables

Using a dual-MA (moving average crossover) EA as an example, the table below shows the performance gap after optimizing on 2020-2022 data and then trading over the out-of-sample period of 2023-2024.

Metric Backtest (Optimized 2020-2022) Forward Test (2023-2024)
PF (Profit Factor) 2.41 0.87
Maximum Drawdown 12.3% 38.7%
Win Rate 68% 41%
Net P&L +$4,820 −$2,110

The PF has plunged from 2.41 to 0.87. A PF below 1.0 means losses exceed gains. This gap is the classic signal of curve fitting. See also How to Read the PF Metric Correctly and What Numbers to Target.

OOS Ratio (Out-of-Sample Ratio)

The OOS ratio (Out-of-Sample Ratio) is widely used as a numerical measure for evaluating curve fitting.

OOS Ratio = Forward Test PF / Backtest PF

  • 0.7 or above: Generalization ability is reasonably maintained
  • 0.5 to 0.7: Suspected over-optimization. Additional validation required
  • Below 0.5: Strong suspicion of over-optimization. Live trading is not recommended

In the example above, 0.87 / 2.41 ≒ 0.36, which falls in the “unfit for live trading” range.

Walk-Forward Analysis

Walk-Forward Analysis splits data into multiple windows in chronological order and repeats the process of “optimize on one window, then validate on the next.” By averaging the OOS ratios across multiple periods, you can statistically evaluate the robustness of the parameters. For example, splitting the full dataset into five segments and repeating the process of optimizing on the first four and validating on the remaining one, staggered across five different time offsets, yields five OOS ratios. If the average of those is 0.7 or above, the EA can be considered to have a reasonable degree of generalization ability.

Common Pitfalls for Beginners

  • Backtest period is too short: Two to three years of data will not include a full mix of trending, ranging, and high-volatility conditions, making it impossible to detect over-fitting to a specific pattern. A minimum of five to ten years covering multiple market environments is required.
  • Too many parameters: An EA with ten or more adjustable variables carries a higher risk of curve fitting. The reason simple logic tends to survive long-term is precisely that it preserves generalization ability. Reducing the number of variables is the most direct path to robustness.
  • Adopting only the peak value and skipping sensitivity analysis: If performance changes sharply when parameters are adjusted one at a time, there is a good chance that peak is a product of chance. Always verify that stable results appear at adjacent parameter values as well.
  • Repeating optimization and validation on the same data: Cycling through “adjust, re-test on the same data, adjust again” turns the validation data into training data. The principle is to keep validation data completely off-limits throughout the development process.
  • Unconditionally trusting backtests provided by EA vendors: Backtests presented by sellers may have been optimized specifically for that period. Use Metrics to Check When Evaluating an EA as a reference, and always verify the OOS ratio, walk-forward results, and the length of the forward test period.

FX AI Lab’s View

At our lab, the OOS ratio and walk-forward analysis are required components of every EA evaluation framework. The AI discretionary system currently in development and testing also continues to apply a strict separation between the backtest period and the out-of-sample validation period. Prioritizing generalization ability for the future over in-sample fit is fundamental to our identity as a verification-driven media outlet. Reading this article alongside The Real Reason Martingale EAs Suffer Deep Maximum Drawdowns will give you a complete picture of the structural risks to avoid when selecting an EA. If you would like to see our verification process in action through copy trading at HFM, please visit the HFM Account Opening Guide.

Related Links

This article is intended for informational purposes only and does not constitute a recommendation to buy or sell any specific financial product or EA. FX trading carries the risk of loss of principal. Please review our Risk Disclosure for details.