Skip to content
All library documents

Optimizing Trading Systems with Balance Curve Regression

Article MQL5 articles

Summary

The article proposes an optimization score that rewards both account growth and a smooth balance curve. It fits a least-squares linear regression to cumulative trade results, measures trend profit from the fitted line’s slope, and compares that return with the regression error. The resulting ProfitStability score can also be adjusted for total traded volume and number of trades, so low-activity passes are less attractive.

The method is implemented with ALGLIB’s regression tools and applied to several MetaTrader expert advisors, including moving-average and MACD examples. The author reports that its optimization results were comparable to the platform’s balance-and-Sharpe criterion, and that volume normalization with forward testing sometimes gave a more realistic assessment. These are tests on the described systems and EURUSD timeframes, not evidence that the score generalizes across strategies or markets. The article also notes possible extensions, such as accounting for how long trades remain profitable or losing.

Key ideas

  • Fit a least-squares line to cumulative trade outcomes to summarize the balance curve’s direction and deviations.
  • The score combines trend profit with regression error to favor growth that is comparatively smooth.
  • Dividing by total traded volume can reduce the effect of different position sizes.
  • Multiplying by trade count discourages optimization passes supported by very few trades.
  • The reported comparisons are limited to selected expert advisors and historical EURUSD tests.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.