How to backtest an event-contract rule with prices you could have traded
Test a rule on past Kalshi event contracts without the most common mistake, using the settled price, and size the sample honestly. A spreadsheet layout and formulas, on hypothetical data.
An event contract on Kalshi pays $1 if its outcome happens and nothing if it doesn't. That makes a backtest simple to state: for each past event, what would the rule have paid, and what did the contract pay back? It is also easy to get badly wrong, because the obvious price to use is the wrong one.
This guide sets up an honest test in a spreadsheet. The rule and the results are hypothetical, for illustration.
The trap: settled prices
After an event resolves, its contracts trade at or near $1 (it happened) or $0 (it didn't). If your history's "last price" for each contract is that final print, a rule that "buys" at the last price will look like a near-perfect predictor. It is reading the answer.
The fix is a snapshot: the price at a fixed time before the event closes, such as 24 hours before, the same for every contract. That is a price someone could actually have paid with the information available then. In Jordan, history collected from Kalshi can include a snapshot column for exactly this.
The rule and the layout
Hypothetical rule: for each monthly CPI release, take the range priced highest 24 hours before the release. One row per release:
| Release | Price 24h before | Settled Yes? | Result per contract |
|---|---|---|---|
| 1 | $0.32 | 1 | $0.68 |
| 2 | $0.30 | 0 | −$0.30 |
| 3 | $0.35 | 1 | $0.65 |
| 4 | $0.28 | 0 | −$0.28 |
| 5 | $0.31 | 0 | −$0.31 |
| 6 | $0.34 | 1 | $0.66 |
| 7 | $0.29 | 0 | −$0.29 |
| 8 | $0.33 | 0 | −$0.33 |
The result column is one formula, filled down:
=Settled − Price − Fee
Leave a labeled cell for the fee per contract and point every row at it. The results above are before fees; look up the exchange's current fee schedule and put the real figure in that cell, because fees take a meaningful share of a contract that costs 30 cents.
Step 1: The summary
| Measure | Formula | Value |
|---|---|---|
| Events | =COUNT(C2:C9) |
8 |
| Hit rate | =AVERAGE(C2:C9) |
37.5% |
| Average price paid | =AVERAGE(B2:B9) |
31.5% |
| Total result | =SUM(D2:D9) |
$0.48 |
The comparison that matters is the hit rate against the average price. A contract priced at 31.5 cents is, roughly, the market saying 31.5%. If the rule's picks came true 37.5% of the time, that looks like a gap in the rule's favor.
Step 2: Is the gap real?
With eight events, almost certainly not. The standard error of a hit rate around 31.5% over 8 events is:
=SQRT(0.315 × (1 − 0.315) / 8) → about 16 points
A 6-point gap inside a 16-point margin of noise tells you nothing. To get the standard error down to about 3 points, you'd need roughly 240 independent events. Monthly CPI releases give twelve a year.
That is the real lesson of most event-contract backtests: the data runs out before the noise does. Ways to get more evidence honestly:
- Pool similar markets, such as every monthly economic release, as long as the rule is the same and the events are independent.
- Bucket by price. Group every contract by its snapshot price (10–20 cents, 20–30 cents, and so on) and compare each bucket's average price with how often it settled Yes. This is a calibration table, and it uses every contract, not just the rule's picks.
- Decide the rule before you look. Trying ten rules and keeping the best one finds noise. Write the rule, the snapshot time and the fee down first.
Common mistakes
- Settled prices as entries. The single most common error. Use a snapshot from before the close.
- Different snapshot times per event. A price 2 hours before one release and 2 days before another isn't the same test.
- No fees. Small per-contract fees change the result on cheap contracts.
- Overlapping events counted as independent. Ranges from the same release move together; count each release once.
Frequently asked questions
What price should I use to backtest event contracts?
A snapshot from a fixed time before each event closed, the same for every event, ideally the bid-ask midpoint or the price you could have bought at. Never the final settled price.
How many events do I need for a reliable backtest?
More than most people expect. For a hit rate near 30%, about 240 independent events bring the standard error to roughly 3 points. A dozen events can't separate a real effect from luck.
Can Jordan collect historical Kalshi data?
Yes. With your own Kalshi key connected, Jordan collects a series' settled history into a sheet, including prices from a chosen number of hours before each event closed. It reads data only and never trades.