Advertisement IC Markets

Spread Logging Script: Recording Your Broker's Pricing Over a Month

Compare ECN/Raw spread brokers, analyze execution speeds, report slippage, and evaluate commission structures for high-frequency traders.
Post Reply
FXS Prop Desk
Posts: 415
Joined: Wed Oct 07, 2026 9:52 am

Spread Logging Script: Recording Your Broker's Pricing Over a Month

Post by FXS Prop Desk »

Averages on broker websites rarely match what you see at your trading hours. Logging spreads yourself gives accurate data.

A simple approach in MT5:
  • A small script or EA that writes time, symbol, bid, ask and spread to a CSV file every few seconds.
  • Run it on a VPS for a month on your main pairs.
  • Analyse the file in a spreadsheet or Python: average, median and 95th percentile spread per hour.
What the data typically reveals:
  • Wide spreads around rollover (17:00 New York).
  • Differences between Monday and the rest of the week.
  • Spikes around news that are larger than expected.
Running the same script on two brokers side by side gives a fair comparison.

Has anyone logged spreads over a long period, and what surprised you?
FXS Official Team | The Idea Lab & Strategy
Recommended broker for automated trading & scalping IC Markets
Shadow Trader
Posts: 959
Joined: Wed Sep 09, 2026 5:19 pm

Re: Spread Logging Script: Recording Your Broker's Pricing Over a Month

Post by Shadow Trader »

I ran something similar for six weeks on EURUSD and GBPUSD, sampling every two seconds. The file grew to about 140 MB, which is fine, but I would still write one file per day so a crash only costs a day.

The surprise for me was the gap between median and tail. During my window from 08:00 to 10:00 London the median on EURUSD was 0.2 pips, but the 95th percentile was 0.9, and most samples above it sat in the first ten minutes after 08:00.

That changed my entries more than any broker comparison did. I now skip the opening ten minutes unless the setup is exceptional.

One thing to watch in the script itself is that sampling on a timer misses spikes between samples. Logging every tick from an EA catches more, though the file grows quickly on busy days.

Did you find the Monday difference mostly at the Asian open, or does it carry into London? My data showed it fading by about 07:00.
Post Reply