Discussing the article: "Network Momentum for MetaTrader5: Trading the Lead-Lag Graph Between Markets"

Check out the new article: Network Momentum for MetaTrader5: Trading the Lead-Lag Graph Between Markets.

This article builds a trend-following Expert Advisor that trades momentum spillover across markets, implemented fully in MQL5 without external solvers. It detects leaders with Derivative Dynamic Time Warping, learns a sparse weighted network by convex optimization, and propagates momentum through it with a reverting response. Readers get a step-by-step, reproducible pipeline and a working EA ready to run in the Strategy Tester.

Most trend-following systems treat each market as an island, asking one question in isolation: is the price trending up or down right now? The moving-average crossover, the MACD and the breakout channel — all of them read one series and act on that series alone. This works, and it has worked for decades, but it quietly throws away a large piece of information: markets do not move independently. A move in crude oil bleeds into the currencies of oil exporters. A turn in an equity index leads the risk-sensitive currencies that track it. A shift in metals shows up later in the commodity dollars. When one market consistently moves before another, the leader's trend today is a clue about where the lagger goes tomorrow. This is momentum spillover, and it is invisible to any indicator that looks at one chart at a time.

In this article we build an Expert Advisor that reads a basket of markets rather than one chart at a time. It infers which of them tend to lead which, assembles those lead-lag relationships into a weighted network, and lets each market's momentum flow along the edges to its neighbours. The result is a single number per symbol, a network momentum signal, whose sign decides whether we go long, short, or flat. The method comes from a 2025 research paper, and the implementation is done entirely in MQL5, with no Python, no external solver, and no pre-computed files: the EA gathers its own data, learns the graph on the fly, and trades the signal it computes.

The strategy is a faithful implementation of the paper's Derivative Dynamic Time Warping pipeline, adapted from the paper's commodity-futures universe to a basket of foreign-exchange pairs and cross-asset instruments that a retail MetaTrader 5 account actually carries. We will walk through the theory, then build the engine module by module in pure MQL5, wire it into a live EA, and finish by running it on the Strategy Tester to confirm the whole machine works end to end and trades coherently.

Momentum spilling from leader markets to lagger markets along network edges


Author: Muhammad Minhas Qamar

The cross-market lead-lag approach is interesting, particularly the attempt to translate the network relationship into a fully implementable MQL5 EA. I would be interested in how the lead-lag structure and model parameters are validated out of sample after the network has been constructed. In particular, separating parameter selection from the final untouched OOS period and including spread, commission, and slippage assumptions seems important when assessing whether the observed momentum spillover is robust.
Yogesh Kaushik #:
The cross-market lead-lag approach is interesting, particularly the attempt to translate the network relationship into a fully implementable MQL5 EA. I would be interested in how the lead-lag structure and model parameters are validated out of sample after the network has been constructed. In particular, separating parameter selection from the final untouched OOS period and including spread, commission, and slippage assumptions seems important when assessing whether the observed momentum spillover is robust.
The graph is rebuilt only from closed daily bars before each trade, and the core parameters (alpha, beta, speeds, windows) come straight from the paper without tuning. So the lead-lag structure itself is estimated out of sample as it goes.

The tester runs in the article were only meant to show the EA works end to end, not to prove an edge. There was no separate untouched OOS period, and costs weren't modelled beyond the tester's spread. A proper check would be a multi-year walk-forward with a final holdout, real commission and slippage, and a comparison against plain momentum without the network. That's the next step I'd like to take with it.