Markov — Technical Manual

Markov — Technical Manual

17 June 2026, 17:57
Artem Koliada
0
33

Markov — Technical Manual

How the Markov Model and Time Exponent Work in the Prime Series

Prime Series • Artem Koliada • https://www.mql5.com/en/users/miluart/seller

This manual explains the mathematics behind the Markov model in my indicators—from the free Markov Prime to how the same core works inside the Prime Confluence Engine. It is written for traders who want to understand WHY a signal appears, rather than just seeing an arrow.

1. The Main Idea: The Market as a Set of States

It’s based on a simple idea: at any given moment, the market is in one of three states. Instead of looking at the raw price, I classify each bar into one of these states:

  • UP — the bar showed a significant upward movement;

  • DOWN — the bar showed a significant downward movement;

  • FLAT — the movement is insufficient to be considered directional.

The key question of the Markov model is: “If the market is currently in a certain state, which state is most likely to follow?” The transition matrix answers precisely this question.

How the state (classification) is determined

A bar is not classified as UP simply because it closed higher. The movement must be significant relative to current volatility. I take the smoothed price change over several bars and compare it to a threshold tied to the ATR:

threshold = K × ATR (K = 0.40 by default)

if change > threshold → status = UP

if change < −threshold → state = DOWN

otherwise → state = FLAT

The link to ATR is intentional: in a calm market, even a small movement is significant, while in a volatile market, that same movement is just noise. The threshold adjusts itself to volatility, so the classification remains accurate in both conditions.

2. The Transition Matrix — the Heart of the Model

After reviewing the history, I count how often each state transitioned into every other state. This yields a 3×3 table—the transition matrix. Each cell represents the probability of transitioning from one state to another:

from \ to

FLAT (current)

UP (current)

DOWN (current)

FLAT

P(F→F)

P(F→U)

P(F→D)

UP

P(U→F)

P(U→U)

P(U→D)

DOWN

P(D→F)

P(D→U)

P(D→D)

For example, if historically, after an UP state, UP followed in 68% of cases, this is a strong indication that the upward momentum tends to continue for this instrument and timeframe. If, on the other hand, DOWN most often followed UP, the market is prone to reversals, and you should proceed with caution when acting on the same signal.

Laplace Smoothing (Why the Model Doesn’t Divide by Zero)

If a certain transition has never occurred in history, its “raw” probability would be zero—and zero is dangerous in statistics (it implies “this will NEVER happen,” which is incorrect for the market). Therefore, a small constant is added to each counter (Laplace smoothing). This prevents any probability from falling exactly to zero and makes the estimates more stable over a short history.

3. Time Exponent — a market regime filter

The Markov matrix tells us WHERE the market is more likely to go. The Time Exponent tells us whether we should trust directional signals at all right now. It is a measure of the “character” of the movement—whether it is orderly (a trend) or chaotic (a sawtooth pattern).

Technically, this is an estimate of the fractal dimension of price using log-log regression: I look at how the cumulative distance of price movement increases with time scale. The result is a single number:

  • low (below ~0.55)—the market is sluggish, flat; directional signals are unreliable;

  • medium (~0.55–1.70) — healthy trending market; signals can be trusted;

  • high (above ~1.70) — chaotic, choppy movement; the risk of false signals increases.

Markov and Time Exponent work in tandem: Markov provides the direction, while Time Exponent confirms that the timing for a directional trade is generally appropriate.

4. Adaptive Training Window

How much historical data should be used for the transition matrix? Too little—estimates are noisy; too much—the model clings to a regime that has long been obsolete. Markov Prime solves this with an adaptive window: it automatically shrinks when the market changes character (transition behavior diverges from recent patterns) and expands when the regime is stable. This ensures the model always learns from a relevant amount of historical data, rather than a fixed number of bars chosen at random.

5. How This Is Used in Different Versions

All products in the series are based on a single Markov core, but each is tailored to its own philosophy. That’s why settings that look the same produce different results—this is by design. The columns below show the specific differences between the free version, Pro, and Prime Confluence Engine.

Aspect

Markov Prime FREE

Markov Prime PRO

Prime Confluence Engine

State Classification

0.40 × ATR

0.40 × ATR

0.40 × ATR (hard-coded)

Training Window

Adaptive

Adaptive

Fixed (InpMarkovBars)

Chain order

1st

1st + calibration

1st (current)

Confidence Score 0–100

Yes

Time Exponent

From a new bar (reactive)

From the new bar (reactive)

From the previous bar (smoothed)

Markov role

Independent signal

Independent signal + Score

Layer 3 of 3 (Confluence)

Character

Radar

Radar + Calibration

Sniper

Markov Prime FREE — Radar

Responsive and fast. The Time Exponent is calculated from the most recent bar, and the adaptive window seeks the best immediate probability. The goal is to quickly capitalize on the current advantage. It’s like a radar: sensitive, instantaneous, and focused on the immediate probabilistic edge. This is a complete, working implementation of the Markov model—for free.

Markov Prime PRO — Calibrated Radar

Pro takes the same core and adds two layers on top. The first is probability calibration: the model compares its own past predictions with what actually happened and corrects for overconfidence (a stated “70%” actually means around 70%). The second is the Confidence Score 0–100: a single number that combines probabilistic advantage, model stability, and the Time Exponent. In other words, Free shows the direction, while Pro also indicates how much you can trust that direction.

Prime Confluence Engine — the sniper

In PCE, the same Markov core becomes the third layer in a three-layer system (Renko + PrimeTrend + Markov). Here, the philosophy is the opposite of speed: stability is more important. The Time Exponent is calculated from the oldest bar (smoothing out short-term noise), and the Markov window is fixed (hard-coded threshold of 0.4×ATR) so that the layer remains synchronized with the rest of the system. A signal is generated only when all three layers agree—fewer signals, but each is confirmed by three independent sources.

The free version acts like a radar—adaptive, reactive, seeking an immediate advantage. PCE acts like a sniper—rigid, smoothed, waiting for all layers to agree before passing a signal.

Where is this heading?

The core architecture is already ready for a second-order Markov chain—a natural next step that takes into account not only the current state but also the one before it, making predictions even more accurate. Since the core is shared across the entire series, this enhancement will naturally strengthen the Prime Confluence Engine in future updates—so that the paid product becomes even more powerful as the core evolves.

6. Conclusion

The Markov model transforms raw price data into a question of probability: “Given where the market is now, what is statistically most likely to happen next?” The Time Exponent filters out moments when this question is unreliable. The adaptive window keeps the model focused on relevant history. And the way each version configures this core—reactive in Free, calibrated in Pro, smoothed and validated in PCE—defines its character.

You can always ask questions about a specific parameter or behavior on a particular instrument on the page for any of the products—I’d be happy to explain in more detail.

       Free  MT5  &  MT4        

            MT5   


              MT5     MT4