Skip to content
All library documents

Choosing ALGLIB Optimizers for Constrained and Nonlinear Search Problems

Article MQL5 articles

Summary

This article surveys ALGLIB optimization methods available in MetaTrader 5, focusing on box-constrained optimization (BC), nonlinear constrained optimization (NLC), and Levenberg–Marquardt (LM), alongside methods covered in an earlier installment. It explains how BC handles parameter bounds, describes the need for feasible starting values and parameter scaling, and outlines a callback wrapper that tracks objective evaluations, best results, and termination limits. The methods are compared on multidimensional test functions rather than on trading strategies.

The reported comparisons vary by problem type and dimension: NLC performs best on low-dimensional hilly functions, LM leads on higher-dimensional cases, NS excels on low-dimensional functions with sharp extrema, and BC leads on higher-dimensional versions. For a discrete test problem, NS leads at smaller dimensions and BLEIC at larger ones. The article describes the differences as modest and calls NS relatively universal, while noting it cannot be forcibly stopped. Results depend on the test functions and implementation; they do not establish which optimizer will work best for a particular trading objective.

Key ideas

  • BC is designed for optimization with variable bounds and requires a feasible or near-feasible starting point.
  • ALGLIB methods use objective-function callbacks, so a wrapper can track evaluations, retain the best candidate, and request termination.
  • Parameter scaling and initial values matter because the methods are deterministic and sensitive to the relative scales of variables.
  • The best-performing method changes across the tested function families and dimensions.
  • The benchmark results are limited to the selected test problems and do not demonstrate trading performance.

Tags

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