Discussing the article: "How to Train an MLP Using Markov Chain Features in MQL5"

Check out the new article: How to Train an MLP Using Markov Chain Features in MQL5.

The article describes the two-level MarkovMLPOscillator indicator: a three-state Markov chain uses historical data to construct a transition matrix and generate 15 probabilistic features for each bar, and an MLP is trained on these features to predict price direction at a specified forecast horizon. The article covers feature generation, the validation procedure using a holdout set, and parameter settings. The result is an interpretable oscillator with a color histogram, a smoothed signal, and a display of the current transition matrix.

In this article, we will systematically construct a regime-dependent market model based on a Markov chain and a multilayer perceptron (MLP). Instead of feeding the price series directly into a neural network, we will first give market behavior a mathematical structure: the market will be represented as a Markov chain with three states describing different market phases. We will examine why a three-state model was chosen, how a vector of 15 probabilistic features is formed from the chain’s transitions, and how these features are used to train an MLP, followed by validation on a holdout set.

Next, we will examine the model's results, compare it with baseline approaches, and discuss its practical implementation in the form of the Markov_MLP_Oscillator.mq5 indicator. At the end of this article, we will provide recommendations on how to configure the parameters and use the model in real trading conditions.

How to Train an MLP Using Markov Chain Features in MQL5


Author: Galym Yechshanov

Thanks, Galym. One thing that was interesting was how, once you fix the transition matrix, the one- and multi-step probabilities and their entropies are determined by the state. A useful follow-up could be to compare the full 15-feature model against an MLP with just the current state and its lags, using the same training and validation data, to see whether the representation of probabilities makes learning of these models easier.