Skip to content
All library documents

Measuring Intraday Spread Costs from Broker Tick History

Article MQL5 code base

Summary

The document describes an indicator that groups broker tick quotes by server hour over a configurable history window. It reports median and 90th-percentile spreads, with optional mean and maximum statistics, and can compare the spread with a user-entered stop size. A time-weighted sampling mode is also available. The live spread and current hour are displayed alongside the hourly profile, and statistics can be exported as CSV.

Examples from a demo account show wider spreads around the daily rollover for EURUSD and GBPUSD, while XAUUSD has equal medians across hours with data and a daily break without ticks. The method helps traders identify hours when spread costs may consume a large share of a stop or expected move. Its estimates depend on the broker’s tick history, account type, server time and the selected sampling mode; historical percentiles do not predict future spreads, and cross-pair currency costs use current tick values.

Key ideas

  • Hourly tick distributions reveal spread patterns that bar history can hide.
  • The median describes a typical spread, while the 90th percentile shows a wider but recurring condition.
  • Comparing spread with stop size helps assess transaction costs relative to trade risk.
  • Server time, broker history and account type affect the profile and its interpretation.
  • Historical spread statistics do not guarantee future trading conditions.

Tags

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