Discussing the article: "Machine Learning in Pure MQL5 (Part 1): Logistic Regression from Scratch with SGD"
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Machine Learning in Pure MQL5 (Part 1): Logistic Regression from Scratch with SGD.
The series develops machine learning in 100% native MQL5 with no external dependencies. Part 1 delivers logistic regression from first principles: a CLogReg class with standardization, a stable sigmoid, SGD training, and model persistence, plus a script that builds ATR-normalized features, labels the next bar, and tests out-of-sample against a baseline. Readers get a compact include file and a clear template for leakage-free evaluation.
There is no shortage of machine learning on this site, but almost all of it leans on something outside the terminal: a Python bridge, an ONNX runtime exported from scikit-learn or PyTorch, an external library pulled from a repository. That is fine until you want to run the thing on a plain VPS with nothing installed, or ship it to someone who does not have your toolchain, or simply understand what the model is actually doing instead of treating it as a black box behind an import.
This series takes the other road. Every model in it is written from scratch in 100 percent native MQL5: no Python, no ONNX, no DLL, no third-party library, and not even the built-in matrix type. Just double arrays and arithmetic you can read line by line. The result is a small, dependency-free machine learning library that compiles anywhere MQL5 does and that you own completely. The most complete existing series on the topic is the Data Science and Machine Learning series. It starts from scratch, moves to the matrix type by Part 3, and uses Python and ONNX in later parts. It also packages the code as an external repository. This series holds the opposite line the whole way: nothing installed, nothing imported, the code is the deliverable.
Part 1 is the foundation, and it is deliberately the simplest useful model there is: logistic regression, which is nothing more than a single neuron. Everything later in the series, up to a small neural network, is built from the pieces we lay down here. This is a teaching and tooling article, not a trading system, and it makes no promise of profit.
Author: Martin Alejandro Bamonte