Using SLSQP to Estimate Conditional Volatility Models in MQL5
Summary
This article replaces an augmented Lagrangian optimizer in an MQL5 volatility-model library with Sequential Least Squares Programming (SLSQP). The motivation is a mismatch between parameter estimates from the MQL5 implementation and Python’s ARCH module, despite using the same data and starting values. Cross-platform checks of the log-likelihood objective found nearly identical calculations when supplied with known parameters, which points to the optimizer as a source of divergence.
The article explains SLSQP’s approach: repeatedly solve quadratic programming subproblems using local approximations, while an active-set method handles equality, inequality, and boundary constraints. It describes a MQL5 implementation based on Kraft’s Fortran algorithm, with numerical differentiation available when analytic gradients are absent, and shows integration and comparison workflows. Examples report close agreement for a simple ARCH specification and larger discrepancies for other models before the change. The evidence is specific to the described tests; the excerpt does not provide comprehensive post-change performance results across datasets or configurations.
Key ideas
- The optimizer change aims to bring MQL5 volatility estimates closer to those from Python’s ARCH module.
- Objective-function checks with known parameters found nearly matching log-likelihood calculations across platforms.
- SLSQP solves successive quadratic subproblems and uses an active-set strategy to manage constraints.
- The MQL5 implementation supports bounds and equality and inequality constraints, with numerical differentiation when needed.
- Reported discrepancies vary by model, so the test examples do not establish universal cross-platform agreement.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.