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: 1689
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: 5594
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.
Shadow Trader
Posts: 5594
Joined: Wed Sep 09, 2026 5:19 pm

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

Post by Shadow Trader »

Since my last reply I cut the same log by minute around rollover, because the hourly view had smoothed it into almost nothing. The real picture only appears at one minute resolution.
img_13666_r2.png
img_13666_r2.png (113.92 KiB) Viewed 99 times
The chart covers EURUSD from 16:45 to 17:20 New York across six weeks. The median sits at 0.3 pips until 16:58, jumps to 1.6 at 17:00, and the 95th percentile peaks at 3.8 pips at 17:01.

Both lines are back under 0.4 by 17:12. Averaged across the whole window the median is only 0.5 pips, which looks harmless and hides minutes where a tight stop can be hit by the spread alone.

That matters most for long positions held through the roll. The stop triggers on the bid, and with the ask pushed up and the bid pushed down, a 3 pip stop has very little room left.

I now either flatten before 16:55 or move any overnight stop to at least 5 pips. The log is what convinced me, not the broker page.
Shadow Trader
Posts: 5594
Joined: Wed Sep 09, 2026 5:19 pm

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

Post by Shadow Trader »

Liquidity providers often quote different prices depending on the size of the request. A streaming ladder may show a tight price for one amount, a wider one for a larger amount, and wider still for a larger amount after that. The same logic exists inside brokers that pass quotes on to clients.

Tiering also operates by client. A provider may apply different spreads to different counterparties depending on observed behaviour, credit, and trading volume. Two accounts at the same broker may therefore see slightly different prices or receive different fill quality, depending on how the broker segments its flow.

Small size does not always mean the best price. Where a provider tiers its streams, the top tier might apply to modest sizes, but very small orders may be handled in a separate retail stream carrying a larger markup.

Scalpers can probe this by recording quoted spreads and realised costs across several order sizes and times of day. If costs move in clear steps instead of smoothly, a tiered structure is likely in place. A written execution policy may confirm it.
Post Reply