betting_combat.rounds.market.bell
The bell from the market: the rule that reads the end of round k off Kalshi’s rounds market
‘the fight ends before round k+1’ (before_r{k+1}), shared by the card run
(trading.bell.BellWatch, print by print) and the backtests (rounds.backtest.working,
on a recorded tape).
gate nothing before the feed's anchor of round k + ``GATE``candidate a trade group (the prints of one moment) with a print at or below ``LOW`` and none above ``HIGH``; a group with any print above ``HIGH`` (a sweep through the threshold, a finish) clears the candidatefire the candidate held for ``HOLD`` with no print above ``HIGH``the bell the fired candidate's print: the round ended about then; the next round starts ``BREAK`` laterStudy (scratchpad bell, 2026-10-04; 33 cards, 362 bells, 147 rounds that ended in a finish):
fires a median 9 s after the bell (the feed: 47 s), no false fire on the finished rounds at the
measured feed lags (FEED_LAG: the feed’s round anchor is 21-81 s late, median ~45 s).
Functions
bell_since
bell_since(f: Mapping[str, Any], k: int) -> pd.Timestamp | NoneWhere the search for round k’s bell starts (tape_bell(since=)): round k’s start by
round k-1’s market bell (+ BREAK) when it fired, else the end of the card’s previous
listed fight (pre_anchor), else the tape’s start (None). Never the fight clock, which
is anchored on the fight’s result (the CV audit, 2026-10-11: its +-3 min window around the
clock’s break missed a bell where that clock ran early, more often by outcome).
fight_bells
fight_bells(fights: pd.DataFrame, side_trades: pd.DataFrame, max_rounds: int = 5) -> pd.DataFramePer fight (fight_id, start, rounds) the market’s bell of every round k that
has a bell market (‘ends before round k+1’, A-framed rounds_before_{k+1} in the side
trade table): bell_k and fire_k (NaT: none), k = 1 .. max_rounds - 1. The
rows’ clock places the breaks on them (windows.row_times).
market_bell
market_bell(prints: pd.DataFrame, gate: pd.Timestamp) -> tuple[pd.Timestamp, pd.Timestamp] | None(the bell, the fire) of the rule on a recorded tape (ts, yes_price), read as a
card run polling every instant would: the first candidate at or after gate held
HOLD with no print above HIGH; None when it never fires.
round_bell
round_bell(prints: pd.DataFrame | None, around: pd.Timestamp | None = None, since: pd.Timestamp | None = None) -> tuple[pd.Timestamp | None, pd.Timestamp | None, pd.Timestamp | None](the tape’s bell, the market’s bell, its fire) of one round on its bell market’s tape,
the live gate placed as the live feed would (the tape’s bell - 5:00 + FEED_LAG +
GATE); Nones where there is none. around: roughly when the round ended;
since: search from there instead (tape_bell).
tape_bell
tape_bell(prints: pd.DataFrame, around: pd.Timestamp | None = None, since: pd.Timestamp | None = None) -> pd.Timestamp | NoneThe bell as the whole tape shows it afterwards (the study’s reference, NOT causal): the
first print at or below HIGH after which nothing prints above 5c, within 8 minutes
before and 3 after around — or, with since, at or after it to the tape’s end (the
rows’ clock: bell_since). The backtests place the live gate from it (the feed’s
anchor = this - 5:00 + FEED_LAG). The market ‘ends before round k+1’ settles at 0
exactly when round k+1 starts, so a bell exists only for a round the fight survived: what
the row after it conditions on anyway.