← sources

Reminder to be careful with timestamps when backtesting

source: reddit (reddit:algotrading)published 2026-10-14 04:23ingested 2026-10-15 02:43

retained text

Say you have a dataset. It says X event happened at time Y. There is a very good chance it did not happen at time Y.

This is due to:

1. Measurement error
2. The timestamp does not mean what you think it means

For example, say you are using the SEC Corpus. Claude and other LLMs will advise you to use acceptance datetime.

https://preview.redd.it/5mm8f8swycvh1.png?width=1554&format=png&auto=webp&s=ad1e087b042162a4ed2312f5db374a558b0ab25e

This is a bad idea.

Acceptance datetime is not when the filing has been released to the public. It actually may be days prior. For example, a filing accepted on a Friday, may be released to the public on Monday.

Also, the SEC misreports acceptance datetime on most of its endpoints. There is an issue where it assigns either the exact timestamp, +4, -4 or +5,-5 (depending on DST). The correct timestamp is found (generally) within the [SEC filing's SGML file](https://www.sec.gov/Archives/edgar/data/1318605/000110465923015159/0001104659-23-015159.txt).

Additionally, SEC data is often published first via newswire. So, markets may have already reacted to the news.

This extrapolates to other datasets. One way to improve backtesting performance is to create features that assume that timestamp may not be quite correct. If this works, it is a sign that there may be something off with your datasets timestamps.

Links (can remove, not sure if falls afoul of self promotion):

* SEC filing detected time dataset: [GitHub](https://github.com/john-friedman/datamule-data/blob/master/data/datasets/detected_time_2025_12_03.csv.gz)
* Bad timezone timestamps: [GitHub](https://github.com/john-friedman/SEC-Filing-Metadata/blob/master/research/acceptanceDateTime.md)

document fetched 2026-10-15 00:48 · canonical https://reddit.com/r/algotrading/comments/1x5hwso/reminder_to_be_careful_with_timestamps_when