Skip to content

betting_combat.rounds.backtest.noko

The ‘no KO’ strategy’s backtest (2026-10-26): Kalshi’s ‘ends by KO/TKO/DQ’ market, its NO side, under the joint execution’s rules (rounds.live.noko: Kelly on the fight’s two outcomes, the min edge, the order and fight caps, sells at the breaks, in-round adds and cuts). Research: data/ufc/cito/assess/exec/b07_noko.py (the breaks) and b08_noko_inround.py (the round), with the KO market’s measured depth; reproduced to the cent (tests/primary/test_noko_parity.py).

breaks per round start k >= 1 whose market bell fired (``break_rows``: the bell rows),
in round order: the minute bar at or before the bell (NO's ask = 1 - YES bid,
NO's bid = 1 - YES ask, YES bid / ask = mid -/+ spread / 2), p = P(no KO from
here); a buy at the ask + ``SLIP`` and Kalshi's fee, a sale at the bid - ``SLIP``
less the fee; any holding may be sold
in-round at each minute end m of round r+1 after the break: tau = m - (the market's bell
of round r + 60 s), from tau 60 s, never at or after the next round's bell (nor
the next decision's), while the winner books leave the fight open (fair 3-97c)
and tau < 5:00: p from the split clock (``noko.p_no_ko``); buys only when the
break found the edge, sales only below the holding's cost; each order at most
``vol_share`` x the KO market's dollars in the last ``vol_minutes`` minutes (None:
no volume cap, the depth alone)
fills at most the KO market's measured depth (``DEPTH``: the 25th percentile of the
contracts within 1c of the best price buying NO on the recorded books of
2026-10-10 / 10-17: 167 at a break, 43 in an in-round slice; a sale the same,
unmeasured)
settle at the fight's end: NO pays 1 unless it ended by KO/TKO

Classes

NoKoExecution

The strategy’s switches, as the card run reads them: sales at the breaks (sell), in-round decisions (mid) and whether they may add (mid_add) or cut (mid_cut), their volume cap (vol_share None: none) and interval (mid_interval_s, as joint.JointExecution: minute rows decide once a minute), the fills’ depth.

Functions

break_rows

break_rows(d: pd.DataFrame) -> pd.DataFrame

The strategy’s decisions (BREAK_COLUMNS) from the bell rows: fight_id, event_date, round_idx, the KO market’s bell quote (mk_mof_ko_mid, mk_mof_ko_spread), the fight’s method (y_method) and the primary’s chances (f_p_ko: a KO from here; a_ko, a_sub, b_ko, b_sub: this round’s).

run

run(rows: pd.DataFrame, rule: NoKoRule, x: NoKoExecution, fights: pd.DataFrame, minutes: pd.DataFrame, clock: MethodClock | None, ledger: list[dict[str, Any]] | None = None, flags: list[dict[str, Any]] | None = None, blocked: frozenset[tuple[str, int]] = frozenset()) -> pd.DataFrame

Every fight of rows (break_rows), one row each (FIGHT_COLUMNS), in the order they first appear. fights: the market’s bells per fight (bell_k); minutes: the minute rows of every fight (fight_id, ts, the winner books, mof_ko_bid / _ask / _dvol).

run_fight

run_fight(rows: pd.DataFrame, rule: NoKoRule, x: NoKoExecution, fight: Any | None, minutes: pd.DataFrame | None, clock: MethodClock | None, ledger: list[dict[str, Any]] | None = None, flags: list[dict[str, Any]] | None = None, blocked: frozenset[int] = frozenset()) -> dict[str, Any]

One fight (its break_rows): its P&L and counters (FIGHT_COLUMNS); each trade into ledger; each break’s bet (a candidate, filled or not: the meta model’s rows, backtest.labeler) into flags. blocked: the breaks (round_idx) whose bet is not taken - no buy at the break nor in its round, sales as ever (the joint run’s gate). fight: its row of the fights frame (the market’s bells bell_k); minutes: its minute rows (the winner books, the KO market’s book and dollars).