Advertisement IC Markets

Timestamp resolution: when a second is too coarse

Share, develop, and backtest custom MQL4/MQL5 Expert Advisors, Python data-scraping scripts, trading bots, and automated market alert systems.
Post Reply
Fairman
Posts: 6955
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

Timestamp resolution: when a second is too coarse

Post by Fairman »

Timestamp resolution: when a second is too coarse

Many platforms record time to the second. For a trade lasting minutes, that is fine. For a trade lasting a few seconds, a second is a huge unit.

Within one second, dozens of ticks can arrive. If the data only says that they happened at 10:02:15, their order is unknown, and a test must guess. The same problem hits fill logs: two events within the same second cannot be sequenced.

Millisecond timestamps are the standard in serious research. They make it possible to measure latency, slippage relative to the quote at the moment of the order, and the true sequence of events around news.

Some platforms offer higher resolution data, and many data vendors do. Custom logging in an expert advisor can capture its own timestamps with millisecond accuracy.

Anyone serious about studying short-term execution benefits from recording the time of every click and every response in milliseconds.

Even a simple log with millisecond stamps of order sent, order confirmed, and quote at each moment unlocks analysis that second-level data cannot. Slippage by latency bucket, for instance, shows how much each extra 50 milliseconds costs.

What timestamp precision does the trade journal use, and is it enough for the trades being taken?
It’s Fairman :geek:
Recommended broker for automated trading & scalping IC Markets
Amanhasnoname
Posts: 2060
Joined: Fri Oct 30, 2026 9:45 am

Re: Timestamp resolution: when a second is too coarse

Post by Amanhasnoname »

My EA journal used to log everything with the platform's one-second time, and it was fine until I tried to work out why some of my news-time entries filled so badly. Several of the order sends, confirmations and quote changes all carried the same second, so I could not tell whether the price moved before I clicked or after my order had already reached the server.

I added a small logging routine that writes the local millisecond counter at the moment the order is sent, when the result comes back, and with every tick the EA receives. Once I had a few weeks of that, the picture was clear. Round trips under about eighty milliseconds rarely slipped more than a tenth of a pip, while the slow ones during busy minutes regularly lost three or four tenths.

That was enough to justify moving the EA to a server closer to the broker. Without the finer timestamps I would have kept blaming the broker for something that was partly my own connection, and I would have had no way to measure whether the change helped.
FXS HongKong Scalper
Posts: 543
Joined: Sat Oct 24, 2026 10:15 pm

Re: Timestamp resolution: when a second is too coarse

Post by FXS HongKong Scalper »

Fairman wrote: Even a simple log with millisecond stamps of order sent, order confirmed, and quote at each moment unlocks analysis that second-level data cannot.
For backtests of very short trades, second resolution is a real limitation. Using tick data with millisecond timestamps, where available, helps. Otherwise, testing both the best and worst ordering within a second gives a range of possible results.
FXS Official Team | Hong Kong Session Desk
Post Reply