Check Overlapping Event Observations in Validation
If you have read /blog/walk-forward-testing-trading-strategies, you already know the shape of the problem: shuffle a time series into random folds and you end up training on the future and testing on the past. That post covers the general fix. This one is narrower and more practical. In event contracts, a single observation is not a point in time. It is a span. A trade opens, a position is held, and the label is not known until the market resolves and settles. That span can quietly straddle the boundary between two adjacent folds, and when it does, your validation leaks even if your split timestamps look clean.
The deliverable here is concrete: a small timeline showing when labels or positions span a fold boundary, plus an exclusion worksheet you can fill in per market family. The goal is not to hand you one magic embargo number. There isn't one.
Why an event contract observation is a span, not a point
On Kalshi, the market life cycle has separate steps with separate clocks: listing, open, close, determination, and settlement. Kalshi documents that trading continues until the predetermined close date, and that a market may close and resolve early if the resolving condition is met ahead of schedule. So the close time you cached yesterday is not guaranteed to be the close time today.
Settlement is a later, separate event. Kalshi's life cycle documentation states that a few hours after the result is determined, members receive $1 for each correct contract held at expiration, and that settlement typically happens about three hours after resolution but can sometimes be longer. Determination itself can take from about one hour to more than twelve hours after close. If a result is placed under review, that window can stretch further.
Two consequences for your folds. First, the label (did YES resolve?) is not available at close; it is available at determination, which is later and variable. Second, the ordinary $1/$0 binary payout is not universal. Kalshi documents scalar settlement bounds where a market can be partly determined before the event ends, and settlement floors that can be raised mid-life. For those markets, the label is not a clean 0 or 1 known at a single instant. Do not assume every contract's YES and NO sum to a dollar or settle at a single moment.
Build the overlap timeline
Draw a horizontal time axis with your fold boundary marked. For each observation, draw two things: the position interval (entry timestamp to exit or settlement) and the label-availability timestamp (when determination makes the outcome known). An observation is contaminated if either interval crosses the boundary into the adjacent fold.
Here is a hypothetical, explicitly illustrative example. Numbers are chosen, not measured from any live market.
Fold A train window: ...........| boundary at 2026-03-01 00:00 UTC
Fold B test window: |...........
obs_1 entry 02-27 12:00 -> settle 02-28 20:00 [fully in A, clean]
obs_2 entry 02-28 22:00 -> determ 03-01 04:00 [position+label cross boundary]
obs_3 entry 02-28 18:00 -> close 02-28 23:30
determ 03-01 09:00 [label crosses boundary]
obs_4 entry 03-01 06:00 -> settle 03-01 15:00 [fully in B, clean]
obs_2 and obs_3 are the leak. A model scored on fold B can
see information whose resolution timing overlaps fold A, and
a feature built from fold A can carry obs_3's not-yet-known label.The point of drawing it is that the leak is invisible in a split-by-timestamp table. obs_3 opened and closed before the boundary, so a naive splitter files it in fold A. But its outcome was not determined until after the boundary, so any feature or target that references it has a timing dependency on fold B.
The exclusion worksheet
Instead of one global embargo, fill this in per market family, because determination and settlement behavior differ by contract type. Work through each row and record the actual value from the contract terms, not a guess.
- Market family and ticker (exact current ticker, preserved, not "first discovery result").
- Close-to-determination lag: minimum and maximum observed, from the contract's rules and timing guidance. Treat this as a range, not a constant.
- Determination-to-settlement lag: Kalshi's guidance is roughly three hours but can be longer, so record a worst case.
- Review risk: can this family enter a review window that delays the known-label timestamp? If yes, your embargo must cover it.
- Payout type: binary $1/$0, or scalar/floor settlement bounds where partial determination applies. Flag non-binary families explicitly.
- Boundary rule: exclude any observation whose position interval OR label-availability timestamp crosses the fold boundary, using the worst-case lags above.
An embargo is just the gap you insert around each boundary so that observations with resolution timing inside the gap are dropped from the neighboring fold. In scikit-learn terms this is the role played by gap-style splitters: community extensions such as tscv add a configurable gap between train and test to mitigate temporal dependence and prevent information leakage. The gap size is not universal. It is the worst-case label-availability lag for the family you are testing, which is exactly what the worksheet produces.
Watch the calibration step too
If you calibrate probabilities, the leak can sneak in through the calibrator. scikit-learn's CalibratedClassifierCV uses a cross-validation approach so that unbiased data is used to fit the calibrator. With cv="prefit" (deprecated in scikit-learn 1.6 in favor of FrozenEstimator, but the disjoint-data requirement applies either way) the docs note that data for fitting the classifier and for calibrating it must be disjoint. If your overlapping observations contaminate the calibration split, your reliability curve looks better than it is. Apply the same boundary exclusion to calibration folds.
Keep the arithmetic exact
When you reconstruct position cost basis and payouts to decide what crosses a boundary, use exact decimal math, not binary floats. Python's decimal module exposes full control over rounding and an option to enforce exact arithmetic by raising on any inexact operation. That matters because cent-level rounding differences can flip whether a marked position looks like a win or a loss near a boundary, and you do not want float noise deciding an exclusion.
Where paper research fits
Once your folds are clean, a forward-paper run is one way to sanity-check that your exclusion logic matches live timing, since a paper engine has to decide when a label becomes available just like your backtest does. Banger (bangertrades.com) is a paper-only research beta for exactly this kind of work: write a Python strategy or clone one, inspect versioned historical backtests, and run bounded paper experiments. Its hosted historical backtesting currently supports Kalshi binary markets. Treat any paper result as evidence under a specific data, fill, fee, and valuation model, not as proof of real execution, and remember a clean fold design does not promise a fill or a return.
Reverify everything that can change. Kalshi's timing rules, settlement-bounds behavior, and the exact ticker you are testing all move, so read the current contract terms at generation time rather than trusting a cached value.
Primary reference to start from: Kalshi's market settlement docs at docs.kalshi.com/getting_started/market_settlement. If you want to try bounded paper experiments once your validation is leak-checked, you can explore the research beta via bangertrades.com/sign-up. No fills or returns are promised.
Sources
- Market Settlement - Kalshi API Documentation
- Settlement Bounds - Kalshi API Documentation
- What is the market life cycle? - Kalshi
- decimal — Decimal fixed-point and floating-point arithmetic — Python documentation
- 1.16. Probability calibration — scikit-learn documentation
- CalibratedClassifierCV — scikit-learn 1.5 documentation
- CalibratedClassifierCV — scikit-learn 1.6 documentation (prefit deprecation)
- tscv: Time Series Cross-Validation — PyPI