Skip to content
All library documents

Using Rolling Spread Statistics to Filter Trade Execution Conditions

Article MQL5 code base

Summary

The document describes a dashboard that compares a live market spread with its recent rolling history. It calculates the rolling mean, standard deviation, minimum and maximum, and a Z-score, then labels conditions as compressed, normal, or unusually wide. The suggested rolling window varies by trading horizon: shorter for scalping and longer for swing trading, with longer windows adapting more slowly to changing conditions.

The tool is presented as an execution filter rather than a signal for market direction. A high spread Z-score may flag news, market opens or closes, thin liquidity, or broker spread widening; a low reading may indicate tighter execution conditions. These interpretations are plausible heuristics, not evidence of improved trading performance. The document gives no measured results, validation method, asset class, or precise threshold values. Its claim that lower spread variation indicates a more stable broker should also be treated cautiously, since spread behavior can vary with instrument and market regime.

Key ideas

  • A rolling window can contextualize the live spread against its recent average and variability.
  • The spread Z-score is used to flag unusually expensive or unusually tight execution conditions.
  • Window length trades off statistical stability against responsiveness to changing conditions.
  • The dashboard aims to filter execution timing and does not predict whether prices will rise or fall.
  • The document provides no performance tests or threshold values to validate the proposed classifications.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.