FREE FINANCIAL EDUCATION
Event-time and availability-time joins
Join features using the latest information actually available at decision time.
What you will learn
Prerequisites: Timestamped tables, market-data latency and look-ahead bias.
- Join features using the latest information actually available at decision time.
- Separate event timestamps, publication timestamps and later revisions.
- Detect future leakage created by a nearest-time join.
Mechanism and decision rules
A trading dataset often contains several clocks. Event time states when an economic or market event occurred; publication time states when it was released; receipt time states when the system could use it. A causal feature join must honor the relevant availability time. Joining by the period a statistic describes can expose information weeks before publication.
For each decision, select only records whose availability timestamp is no later than that decision. A backward as-of join can implement this rule if the inputs and timezone handling are correct. A nearest-time join can select a future observation because it is numerically closer. Revisions need separate vintages: today’s corrected value should not replace the originally published figure in an old decision unless the research question explicitly uses revised data.
Worked example · synthetic data
A synthetic indicator describes the month ending 31 March but is published on 10 April at 08:30. A trade decision on 5 April cannot use it, even though its period-end date is earlier. On 10 April at 08:31, the first release is eligible if the modeled receipt delay has passed.
For a quote join, a 10:00:00 decision has quotes available at 09:59:58 and 10:00:01. A nearest-time match selects the later quote because it is one second away, but that leaks future information. A backward availability join selects 09:59:58 and may then reject it under a stale-data limit.
Failure modes and limits
Backward joins are not automatically safe if timestamps represent event time rather than receipt time. Timezone conversion errors can shift entire releases across sessions. Exact-equality availability needs a convention for processing order. Preserve release versions and latency assumptions so the research timeline can be audited.
Practice case
A decision is at 14:00:00. Features have availability times 13:59:50, 14:00:02 and 14:01:00. The maximum permitted age is five seconds. Which record is causally eligible, and should the signal proceed?
Reveal the worked answer
Only 13:59:50 is available before the decision, but it is ten seconds old and fails the five-second freshness rule. The signal should be blocked under this specification. Choosing 14:00:02 would improve apparent freshness by using information from the future.
Check your understanding
Sources and next steps
The lesson, calculations and synthetic cases are original educational material. References explain underlying contract or chart conventions; none validates the profitability of a trading rule. Actual contract specifications, settlement obligations and charges must be checked before trading.
Explore OHLCV data in the chart lab · Explore volume-at-price and TPO data · Practice library
