betting_combat.trading.bell
The bell from the market: when Kalshi’s rounds market says a round has ended (the rule
itself, shared with the backtests: rounds.market.bell).
The live feed reports the end of a round late (21-81 s after the bell on 2026-09-26 and
10-03: it only switches when the next round STARTS), and the engine finds the break by its
own clock (the feed’s round anchor + 5:00), so a decision lands a median 42 s into the
60-second break. Traders watching the fight move first: the moment round k ends without a
finish, “the fight ends before round k+1” (KXUFCROUNDS-…-{k+1}, role before_r{k+1})
collapses toward 0.
BellWatch reads that market’s prints (study: scratchpad/bell, 2026-10-04; 33 cards,
362 bells, 147 rounds that ended in a finish):
gate no fire before the feed's anchor of round k + 4:00 (``GATE``)candidate the start of the market's collapse: the first trade group (the prints of one moment) with a print at or below 1c and none above 3c after the last group with a print above 3c (a sweep through the threshold, a finish: it clears the candidate). Read from the anchor less ``READ_BACK``, so a collapse before the gate is dated where it happened; and only after a group above 3c was read (a collapse whose start was not read has no known moment: no bell)fire at the gate at the earliest, once the candidate held for 5 s with no print above 3c (``HOLD``) up to the pollcontrary after firing, a print at 50c or more (the fight ended between rounds, or a late finish): recorded, and a working order of that break stopsOn history: fires a median 9 s after the bell (feed: 47 s), no false fire on the 147
finished rounds at the measured feed lags. The feed’s anchor is late by 21-81 s on history
but was up to 3 minutes late on 2026-10-17 (15 on its first fight): a gate past the bell
read only the market’s later 1c prints, and one of them, in the next round, was taken for
the bell (JOUCUA R1: the collapse 00:46:28, the next round from 00:47:28, bought at
00:49:18; BLAJAS R2: bought until 14 s into round 3). Read back, the bell is the collapse,
and a break whose next round has started is not traded (CardSession._decide_rounds:
break missed). Where the anchor is on time the gate precedes the collapse and the rule
is the backtests’ (market_bell), but for a round the market already held at 1c before the
gate (a quiet end of a round): read back, it fires at the gate, before the backtests’ bell
(7 of 365 recorded bells at a 45 s feed lag, 20 at 20 s; never on a round that ended in a
finish).
It decides the break when the portfolio says so
(portfolio.bell_decides); until then the card run records it beside the feed’s decision
(bell_signals) and uses it as a VETO: a feed decision before the bell fires is held (a
break trades only on its fired bell — the training rows have none without it — so a feed
decision before the fire would spend the break: 2026-10-10 ALLDUN R2; and 2026-09-26 VIEBRY
R2: the feed’s clock decided 136 s before the real bell after a pause inside the round). The
hold ends at the market’s bell, when the feed shows the next round, or at the latest
HOLD_MAX after the round’s anchor (trading.session._vetoed).
The bell also bounds a working order (trading.session): once known (its candidate print,
the first <= 1c print the fire confirmed), a decision’s bets keep buying at most until the
bell + BREAK - portfolio.break_margin_seconds, the next round’s start.
Classes
BellWatch
The bell ending round round_idx of one fight, from its rounds market.
read_from
read_from() -> dt.datetimeWhere the next read of the prints starts: since the first time, then the last
read’s end less READ_OVERLAP (the groups read so far are kept): a read back to
since at every poll would fall off the stream’s memory onto the venue’s API.
released
released(now: dt.datetime) -> boolA held feed decision may go: the market’s bell fired, or the hold has lasted to
HOLD_MAX. Never on the book’s collapse alone: the break trades only on its fired
bell, which follows the collapse by HOLD and more.
row
row(card_date: dt.date, session_id: str, strategy: str = 'rounds') -> dict[str, object]The bell_signals row (each strategy’s card run records its own).
still_live
still_live(book: BookTop | None, now: dt.datetime, stale_seconds: float) -> boolThe round is still being fought by the market: no fire, and a fresh book with a
bid above LIVE_MID (a missing or stale book is never live). Only names why a
feed decision was held: every one is held until the fire (released).
update
update(prints: Iterable[Print], now: dt.datetime) -> boolRead the market’s prints (any order, repeats ignored) up to now; True when
the bell fires on this call.
Functions
bell_role
bell_role(round_idx: int) -> strThe rounds market whose collapse is the bell ending round round_idx.
collapse
collapse(groups: Iterable[tuple[dt.datetime, float, float]]) -> dt.datetime | NoneThe start of the market’s current collapse in trade groups (moment, lowest print,
highest print): the first group at or below LOW with none above HIGH after the
last group above HIGH. None while the market trades above HIGH, and when no
group above it was read: a collapse whose start was not seen has no known moment.