Linear Algebra for Multi-Target Trading Models in MQL5
Summary
This tutorial introduces matrix and vector operations for readers new to linear algebra, using MQL5 examples to contrast element-by-element loops with matrix methods. It argues that matrix operations can make code more concise and maintainable, and may improve processing efficiency when working with large datasets or repeated calculations such as backtests.
The trading example builds a statistical model to forecast four price-related targets: future moving averages of close, high, and low, plus a future price value. The forecasts are used to define entry, exit, and position-closing filters. The article reports a two-year backtest with a rising account balance, 51% profitable trades, and average profit above average loss. These results are presented by the author as an initial outcome, with further smoothing and improvement planned. The excerpt does not establish out-of-sample robustness, account for execution costs, or provide enough detail to assess whether the reported performance generalizes.
Key ideas
- Matrix and vector operations can replace repetitive loops when transforming market data.
- The tutorial presents matrix methods as a way to make MQL5 code more concise and maintainable.
- Its model forecasts future moving averages of close, high, and low, as well as a future price.
- The forecasts inform entry, exit, and position-closing rules.
- The reported backtest is an initial result and does not establish out-of-sample robustness.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.