Discussing the article: "Testing Random Walk vs Mean Reversion in MQL5: Implementing the Lo-MacKinlay Variance Ratio Test"
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: Testing Random Walk vs Mean Reversion in MQL5: Implementing the Lo-MacKinlay Variance Ratio Test.
Most trading strategies rely on some assumption about price behavior. Mean-reversion strategies expect prices to return to a reference level. Breakout strategies bet on continuation after a range break. Both can work—until market conditions shift. When that happens, a strategy optimized for one regime often fails in another.
A price chart alone can't formally validate these assumptions. Indicators like RSI or Bollinger Bands describe recent price behavior, but they don't test whether returns actually exhibit the serial dependence a strategy expects. An oversold RSI reading doesn't guarantee mean-reversion—it just shows where price sits relative to recent history. So let's step back and ask a more fundamental question: are return increments consistent with the variance-scaling implication of a random-walk or martingale-difference null, or is there measurable dependence across different holding horizons?
Here, we'll implement the Lo-MacKinlay Variance Ratio Test (1988) in MQL5. The test checks whether the variance of k-period returns scales the way a random-walk or martingale-difference null implies it should—specifically, whether the variance of k-period returns grows proportionally with k.
Author: Kayode Michael Oyetunde