Discussing the article: "Markov Chains in Trading and Price Forecasting"

 

Check out the new article: Markov Chains in Trading and Price Forecasting.

In this article, we will examine how to build and apply Markov chains in market conditions: from selecting states and counting transitions to generating forecasts of trajectories and levels. We will also see how Markov chains can be applied to qualitative and quantitative data, ways to account for rare events, and the impact of the forecast horizon. Examples are provided using prices and indicators, as well as an option for evaluating a sequence of trades, with ready-to-use implementations in MQL5.

A Markov chain is a mathematical model that is successfully applied in a wide variety of fields. It was proposed by A. Markov in 1906, in his article "On the Limit Distribution of a Class of Correlated Random Variables," in which he studied the statistical behavior of a chain of correlated random events.

The essence of the model is that it allows us to predict the probability of transitioning from one state to another. Thus, using a Markov chain, we can describe the properties of a given process and generate new sequences that resemble that process. These chains can be used to simulate and analyze processes occurring in the market.

Markov chains are based on two key factors: state and transition probability. The states of the chain can be described using both quantitative and qualitative variables. For example, if a value in a time series falls within the range of 10–20, then it is in state 1. Or, if the time series is increasing, its state is "U." The type of states depends on the process under study, and their number may be fixed or, in some cases, determined by the researcher.

Another important property of chains is that they have no memory. This means that the next state depends on the current state and is not related to the history in any way. Because of this property, Markov chains allow us to model nonstationary financial time series—their properties change over time. This is important during periods of high volatility, when trends can change rapidly and it is difficult to predict how the price will behave.


Author: Aleksej Poljakov