Skip to content
All library documents

Using Matrix Factorization for Two-Output Market Classification in MQL5

Article MQL5 articles

Summary

This article develops an MQL5 linear classifier that predicts two binary outcomes: the expected direction of a moving average and whether price is positioned on the corresponding side of that average. The trading logic buys when both predictions indicate upward conditions and sells when both indicate downward conditions. It uses an ATR-based stop, manages an existing position according to the classifier’s direction signal, and describes matrix operations for fitting the model from historical observations.

The article presents strategy tester performance statistics and concludes that the system has room for improvement, but the supplied text does not give enough detail to assess robustness or reproduce those results. The model is explicitly limited to two binary outputs rather than a general multi-class classifier. Its predictions and threshold rules are presented as a prototype trading approach, not evidence that the classifier has a durable predictive edge.

Key ideas

  • The classifier predicts moving-average direction and price position as two separate binary outputs.
  • The strategy enters long or short only when both predicted outputs agree on direction.
  • An ATR-based stop and the classifier’s direction signal are used in position management.
  • The proposed architecture is limited to two binary outcomes and does not handle arbitrary multiclass labels.
  • The reported testing suggests room for improvement, without establishing robust predictive performance.

Tags

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