{"approach": "Takes cancels away from the base (tick probes, sub-tick belief, quotes one tick inside the competitor, marginal sizing, cheap YES stock from a resting tick-1 bid) and changes nothing else. A census showed where its 2973 cancels a run go (seeds 1000-1599): 2530 are probes re-placed every step, about 103 are the resting stock bids re-placed every step, 143 shrink a quote that is over target, 101 pull a quote left behind when the competitor moved, 61 pull a quote whose target fell to zero, and only 35 hit an order that actually holds a queue place, i.e. one the competitor has queued behind (its replacement lands on our surviving quote's tick each time p crosses one of its quotes). The strategy now (1) keeps a probe while its tick is still wanted and no new order of ours joins that tick, (2) keeps a resting stock bid while it is within 20% of target, (3) keeps a queue-ahead order until it is 4x over target instead of 1.5x, (4) leaves an order one tick behind the quote instead of cancelling it, and (5) holds the competitor's tick only while the queue-ahead order is at least 0.4*(1-1/spread) of the target there, otherwise quotes one tick in front again with the remnant left behind it. Cancels fall from 2973 to 1006 a run. The cancels that were measured to earn their cost are all kept: over-target, zero-target, and orders two or more ticks behind. Result: 108.69 on the tuning seeds against the base's 107.24 there, and 96.09 on the holdout against the base's 96.04 on the same holdout seeds, so the holdout gain is +0.05 +-0.72: retail rose by 2.18 a run and arbitrage loss by 2.13.", "blocked": null, "python_version": "3.12.3", "base_mean_edge": 102.33197908899267, "score": {"mean_edge": 108.6925430884395, "retail_edge": 138.4792002400675, "arb_edge": -29.78665715164867, "simulations": 600, "seed_start": 1000, "failures": 0}, "holdout": {"mean_edge": 96.094069027841, "simulations": 600, "seed_start": 30000, "failures": 0}, "code": "\"\"\"Stale-quote defence with tick probes, a sub-tick belief and cheap YES stock,\nwith the cancels that buy nothing taken away.\n\nEvery step the arbitrageur removes any order on the wrong side of p, so tiny\ntwo-sided probes around the estimate locate p to a tick; a grid filter narrows\nthat further.  Quotes sit one tick inside the competitor and are sized by the\nmarginal rule: one more share is worth quoting while the chance a retail order\nreaches it, times its edge, exceeds the expected arbitrage loss.  Near p=0 a\nretail buy pays almost its whole notional as edge, so YES is held to cover low\nasks, bought by a large bid resting at tick 1 and smaller bids on the tick p is\ncrossing.\n\nCancels (this file's change to the base).  A cancel only gives up a queue place\nwhen the competitor has queued behind the order, which happens each time p\ncrosses a competitor quote: its replacement lands on our surviving quote's tick.\n - Such an order is kept until it is 4x over target (base: 1.5x), since it\n   cannot be re-placed ahead of the competitor.\n - It is held as the quote only while it is at least 0.4*(1-1/spread) of the\n   target; below that the quote steps in front again and the remnant is left\n   one tick behind instead of being cancelled.\n - A probe is kept while its tick is still wanted and no new order of ours joins\n   that tick (a probe ahead of our own size gets eaten by retail and reads as a\n   false crossing).  The resting stock bids are kept while within 20% of target.\nEverything else the base cancels (orders over target, orders left more than one\ntick behind, orders whose target is zero) is still cancelled: each was measured\nto earn its cost.\n\"\"\"\nimport math\nfrom orderbook_pm_challenge.strategy import BaseStrategy\nfrom orderbook_pm_challenge.types import CancelOrder, PlaceOrder, Side\n\nP = dict(lam_r=0.25, m=5.0, sig_n=1.2, lam_j=0.0019, sig_j=0.35, sig=0.02,\n         qmax=3000.0, rmin=2, kA=0.7, kL=0.15, pL=0.05,\n         ammo=1.0, ydem=0.4, W=200.0, fy=0.6, ammo_q=60.0, ammo_pmax=0.05, ammo_maxpay=0.02,\n         fb=0.9, fu=0.7, xu=0.1, sticky=1.0, min_ahead=2.0, keep_hi=1.5, keep_lo=0.7, Hu=300.0, bins=8.0, filt=1.0, uni=0.01, jumpinfo=1.0, dmin=0.0, kLb=0.08, kLf=0.08, pinf=1.0, pre=0.0, H1=100.0,\n         ydf=0.6, Wf=2000.0, g_hi=0.15, g_lo=0.15, qf=400.0, pmaxf=0.05, pre_gap=1.0,\n         ydf1=0.6, g1=5.0, f1=0.6, a1=100.0, nb1=0.0, gs=1.0, p1t=1.0, m1=1.0, zd=1.0, pfl=0.0005,\n         kp=1.0, kr=1.0, band=0.2, khA=4.0, maf=0.4, kd=1.0)\nSQ2 = math.sqrt(2.0)\nSQ2PI = math.sqrt(2.0 * math.pi)\ndef cdf(x): return 0.5 * (1.0 + math.erf(x / SQ2))\ndef pdf(x): return math.exp(-0.5 * x * x) / SQ2PI\ndef inv(p):\n    p = min(max(p, 1e-9), 1 - 1e-9)\n    t = math.sqrt(-2.0 * math.log(min(p, 1 - p)))\n    x = t - (2.515517 + 0.802853 * t + 0.010328 * t * t) / (1 + 1.432788 * t + 0.189269 * t * t + 0.001308 * t ** 3)\n    x = -x if p < 0.5 else x\n    for _ in range(2):\n        d = pdf(x)\n        if d < 1e-12:\n            break\n        x -= (cdf(x) - p) / d\n    return x\ndef lpm(k):\n    return pdf(k) + k * cdf(k)\ndef fl(q):\n    return math.floor(q * 100 + 1e-9) / 100\n\nNODES = [(-2.2, .06), (-1.3, .17), (-0.6, .27), (0.6, .27), (1.3, .17), (2.2, .06)]\nPROBE = 0.01\n\n\nclass Strategy(BaseStrategy):\n    def __init__(self):\n        self.n = 0\n        self.ahead = set()     # main orders placed strictly ahead of any competitor order at their tick\n        self.res = {}          # order id -> uncovered quantity at placement\n        self.bc = None         # belief: sub-tick grid centres (ticks)\n        self.bw = None         # belief: weights\n        self.st = 0.5          # last one-step sd in ticks\n        self.pcb = self.pca = None\n        self.pb = set()\n        self.pa = set()\n        self.tb = 0\n        self.s = None          # competitor spread parameter\n\n    def _oid(self, tag):\n        self.n += 1\n        return tag + str(self.n)\n\n    def on_step(self, state):\n        H = max(1, state.steps_remaining)\n        cb = state.competitor_best_bid_ticks or 0\n        ca = state.competitor_best_ask_ticks or 100\n        if self.s is None:\n            self.s = max(1, (ca - cb + 1) // 2)\n        lo, hi = cb, ca\n        for o in state.own_orders:\n            if o.side is Side.BUY:\n                lo = max(lo, o.price_ticks)\n            else:\n                hi = min(hi, o.price_ticks)\n        if P['pinf'] > 0:\n            sb = {o.price_ticks for o in state.own_orders if o.side is Side.BUY and o.remaining_quantity <= PROBE + 1e-9}\n            sa = {o.price_ticks for o in state.own_orders if o.side is Side.SELL and o.remaining_quantity <= PROBE + 1e-9}\n            ea = self.pa - sa\n            eb = self.pb - sb\n            if sa and ea:\n                lo = max(lo, min(max(ea), hi))\n            if eb and (sb or min(eb) <= P['p1t']):\n                hi = min(hi, max(min(eb), lo))\n        if P['jumpinfo'] > 0 and self.pcb is not None:\n            if ca > self.pca + 1:\n                lo = max(lo, ca - 1)\n            if cb < self.pcb - 1:\n                hi = min(hi, cb + 1)\n        self.pcb, self.pca = cb, ca\n        if lo > hi:\n            lo, hi = hi, lo\n        # sub-tick belief over p_(t-1): predict with one-step noise, truncate to [lo, hi]\n        wid = max(hi - lo, 1e-6)\n        nb = max(2, min(48, int(round(wid * P['bins']))))\n        cs = [lo + (i + 0.5) * wid / nb for i in range(nb)]\n        if self.bc is None or P['filt'] <= 0:\n            ws = [1.0 / nb] * nb\n        else:\n            sg = max(self.st, 0.6 * wid / nb)\n            k = -0.5 / (sg * sg)\n            ws = []\n            uni = P['uni'] * sg\n            for c in cs:\n                t = uni\n                for ci, wi in zip(self.bc, self.bw):\n                    d = c - ci\n                    d2 = d * d * k\n                    if d2 > -12.5:\n                        t += wi * math.exp(d2)\n                ws.append(t)\n            tot = sum(ws)\n            ws = [w / tot for w in ws]\n        self.bc, self.bw = cs, ws\n        mean_t = sum(c * w for c, w in zip(cs, ws))\n        var_t = max(sum(c * c * w for c, w in zip(cs, ws)) - mean_t * mean_t, 0.0)\n        phat = min(max(mean_t / 100.0, 0.002), 0.998)\n        var = P['sig'] ** 2 + P['lam_j'] * P['sig_j'] ** 2\n        sd = math.sqrt(H * var)\n        self.tb = self.tb + 1 if hi <= 1 else 0\n        if self.tb > 0 and P['zd'] > 0:\n            # below the last tick there is no probe: the score keeps walking away from it\n            phat = min(phat, max(P['pfl'], cdf(inv(0.01) - P['zd'] * 0.02 * math.sqrt(self.tb) / sd)))\n        z = inv(phat)\n        Z = z * sd\n        sp = pdf(z) / sd * P['sig']\n        self.st = sp * 100.0\n        s = math.sqrt(sp * sp + var_t / 1e4 + 1e-8)\n        sd1 = math.sqrt(max(1.0, H - 1.0) * var)\n        jp = [(cdf((Z + n * P['sig_j']) / sd1), w) for n, w in NODES]\n        lj = P['lam_j']\n\n        def AB(x):\n            k = (x - phat) / s\n            a = s * lpm(k)\n            b = a - (x - phat)\n            ja = sum(w * max(0.0, x - p) for p, w in jp)\n            jb = sum(w * max(0.0, p - x) for p, w in jp)\n            return (1 - lj) * a + lj * ja, (1 - lj) * b + lj * jb\n\n        if H == 1:\n            def AB(x):\n                return (1 - phat) * x, phat * (1 - x)\n        rho = P['lam_r'] * 0.5\n        mu = math.log(P['m']) - 0.5 * P['sig_n'] ** 2\n        kA = P['kL'] if phat < P['pL'] else P['kA']\n\n        def qsize(loss, gain, px):\n            loss *= kA\n            if gain <= 0:\n                return 0.0\n            tail = loss / (rho * gain)\n            if tail >= 1.0:\n                return 0.0\n            return min(P['qmax'], math.exp(mu + P['sig_n'] * inv(1 - max(tail, 1e-6))) / px)\n\n        ptk = phat * 100\n        def qbid(t):\n            if not 1 <= t <= 99:\n                return 0.0\n            a, b = AB(t / 100.0)\n            if phat * 100 - t < P['dmin']:\n                return 0.0\n            if P['nb1'] > 0 and self.s == 1 and t == 1 and ptk < 1.0:\n                return 0.0\n            if phat < P['pL']:\n                ytg = P['ydem'] * min(H, P['W']) / max(ca - 1, ptk + 1) * 100.0\n                a *= (P['kLb'] if state.yes_inventory < ytg else P['kLf']) / P['kL']\n            return qsize(a, b, max(phat, 0.05))\n\n        def qask(t):\n            if not 1 <= t <= 99:\n                return 0.0\n            a, b = AB(t / 100.0)\n            if t - phat * 100 < P['dmin']:\n                return 0.0\n            return qsize(b, a, t / 100.0)\n\n        bids = [o for o in state.own_orders if o.side is Side.BUY and o.remaining_quantity > PROBE + 1e-9]\n        asks = [o for o in state.own_orders if o.side is Side.SELL and o.remaining_quantity > PROBE + 1e-9]\n        sticky = P['sticky'] > 0\n        def top(orders, comp, step, qf):\n            ah = sum(o.remaining_quantity for o in orders if o.price_ticks == comp and o.order_id in self.ahead)\n            # hold the competitor's tick only while the place in its queue is big enough to matter;\n            # under that share of the target, quote in front again (the remnant stays, see manage)\n            if sticky and ah >= P['min_ahead'] and ah >= P['maf'] * (1.0 - 1.0 / self.s) * qf(comp):\n                return comp\n            return comp + step\n        bid_t = top(bids, cb, 1, qbid)\n        ask_t = top(asks, ca, -1, qask)\n        qb = qbid(bid_t)\n        qa = qask(ask_t)\n\n        Y = state.yes_inventory\n        if ask_t == 1 and H > P['H1'] and P['pre'] > 0:\n            qa = qa if Y >= P['a1'] > 0 else 0.0          # let the competitor's 2-tick ask erode instead of fronting it for nothing\n        # ammunition: hold YES so that low asks are covered\n        ptick = phat * 100\n        amt = 0\n        qam = 0.0\n        if P['ammo'] > 0 and ask_t >= 2 and phat < max(P['ammo_pmax'], P['pmaxf']):\n            wealth = state.cash + Y * phat\n            x = max(ask_t, ptick + 1) / 100.0\n            capw = P['fy'] * wealth / max(phat, 0.005)\n            target = min(P['ydem'] * min(H, P['W']) / x, capw)\n            full = min(P['ydf'] * min(H, P['Wf']) / x, capw) if phat < P['pmaxf'] else 0.0\n            t = max(1, min(99, int(math.ceil(ptick + 1e-9))))\n            g = t - ptick\n            if Y < full and g <= P['g_hi'] and bid_t <= t < ask_t:\n                amt, qam = t, min(P['qf'], full - Y)     # a tick p has just crossed: nearly free\n            elif Y < target and phat < P['ammo_pmax'] and bid_t <= t < ask_t and t / 100.0 - phat < P['ammo_maxpay']:\n                amt, qam = t, min(P['ammo_q'], target - Y)\n            elif Y < full and t >= 2 and 1.0 - g <= P['g_lo']:\n                amt, qam = t - 1, min(P['qf'], full - Y)  # rest just under p: filled only on the crossing, or by retail\n\n        if P['pre'] > 0 and ca == 2 and phat < 0.01 and H > P['H1'] and Y < P['pre'] and not qam and 1.0 - ptick < P['pre_gap']:\n            amt, qam = 1, min(P['ammo_q'], P['pre'] - Y)\n        q1 = 0.0\n        if P['ydf1'] > 0 and P['m1'] < ptick < P['g1'] + 1.0 and amt != 1:\n            q1 = max(0.0, P['ydf1'] * min(H, P['Wf']) / (self.s / 100.0) - Y)\n        # order management\n        actions = []\n        free = state.free_cash - 2.0\n        keep_ask = 0.0\n        new_b = []\n        new_a = []\n        cxl = {}\n        def cancel(o, rest=False):\n            nonlocal free\n            actions.append(CancelOrder(o.order_id))\n            if o.side is Side.BUY and rest:\n                cxl[o.price_ticks] = (o, actions[-1])\n            x = o.price_ticks / 100.0\n            if o.side is Side.BUY:\n                free += x * o.remaining_quantity\n            else:\n                free += (1 - x) * min(self.res.get(o.order_id, 0.0), o.remaining_quantity)\n            self.ahead.discard(o.order_id)\n            self.res.pop(o.order_id, None)\n        f = int(math.floor(ptick + 1e-9))\n        r = max(int(P['rmin']), int(math.ceil(2.0 * s * 100)))\n        wb = {t for t in range(f, f + r + 1) if cb < t < ca and 1 <= t <= 99}\n        wa = {t for t in range(f + 1 - r, f + 2) if cb < t < ca and 1 <= t <= 99}\n        kpb = set()\n        kpa = set()\n        small = [o for o in state.own_orders if o.remaining_quantity <= PROBE + 1e-9]\n        nsa = sum(1 for o in small if o.side is Side.SELL) if P['kp'] > 0 else 0\n        if P['kp'] <= 0:\n            for o in small:\n                cancel(o)\n        kept_ids = set()\n        def manage(orders, t, q, comp, sgn):\n            kept = 0.0\n            for o in orders:\n                ah = t == comp and o.order_id in self.ahead\n                named = o.order_id[0] in 'ab'\n                if named and 0 < (t - o.price_ticks) * sgn <= P['kd']:\n                    kept_ids.add(o.order_id)     # one tick behind the quote: costs nothing to leave, and keeps its queue place\n                    continue\n                # an order the competitor has queued behind cannot be replaced, so it may run further over target\n                if o.price_ticks == t and q > 0 and kept + o.remaining_quantity <= max(q * (P['khA'] if ah else P['keep_hi']), 1.0):\n                    kept += o.remaining_quantity\n                    kept_ids.add(o.order_id)\n                else:\n                    cancel(o, not named)\n            return kept\n        kb = manage(bids, bid_t, qb, cb, 1)\n        ka = manage(asks, ask_t, qa, ca, -1)\n        add_b = (qb - kb) if (kb < qb * P['keep_lo'] and bid_t != cb) else 0.0\n        add_a = (qa - ka) if (ka < qa * P['keep_lo'] and ask_t != ca) else 0.0\n\n        budget = P['fb'] * max(free, 0.0)\n        cost = add_b * bid_t / 100.0 + qam * amt / 100.0\n        if cost > budget:\n            f = budget / cost\n            add_b *= f\n            qam *= f\n            cost = budget\n        out = []\n        def rest(t, q):\n            nonlocal free\n            c = cxl.get(t) if P['kr'] > 0 else None\n            if c is not None and abs(c[0].remaining_quantity - q) <= P['band'] * q:\n                actions.remove(c[1])             # the resting bid is still about the right size: leave it\n                del cxl[t]\n                free -= c[0].remaining_quantity * t / 100.0 + 1e-6\n                return\n            out.append(PlaceOrder(side=Side.BUY, price_ticks=t, quantity=q))\n            free -= q * t / 100.0 + 1e-6\n        q1 = min(q1, P['f1'] * max(budget - cost, 0.0) * 100.0)\n        if q1 >= 0.01:\n            rest(1, fl(q1))\n        if amt and qam >= 0.01:\n            rest(amt, fl(qam))\n        if bid_t >= 1 and add_b >= 0.01:\n            q = fl(add_b)\n            oid = self._oid('b')\n            out.append(PlaceOrder(side=Side.BUY, price_ticks=bid_t, quantity=q, client_order_id=oid))\n            free -= q * bid_t / 100.0 + 1e-6\n            if bid_t > cb:\n                self.ahead.add(oid)\n        if ask_t <= 99 and add_a >= 0.01:\n            x = ask_t / 100.0\n            covk = sum(o.remaining_quantity - min(self.res.get(o.order_id, 0.0), o.remaining_quantity)\n                       for o in asks if o.order_id in kept_ids)\n            cov = max(0.0, Y - covk - 0.1 - 0.01 * nsa)\n            unc = max(0.0, add_a - cov)\n            if unc > 0:\n                ub = max(0.0, free - (1 - P['fu']) * max(state.cash, 0.0)) if x >= P['xu'] else 0.0\n                if H < P['Hu'] and phat < 0.05:\n                    ub = max(0.0, free * (1 - H / P['Hu']))\n                unc = min(unc, ub / (1 - x))\n            q = fl(min(add_a, cov + unc))\n            if q >= 0.01:\n                oid = self._oid('a')\n                out.append(PlaceOrder(side=Side.SELL, price_ticks=ask_t, quantity=q, client_order_id=oid))\n                r = max(0.0, q - cov)\n                self.res[oid] = r\n                free -= r * (1 - x) + 1e-6\n                if ask_t < ca:\n                    self.ahead.add(oid)\n\n        # probes: tiny orders that the arbitrageur removes when p crosses them\n        if P['kp'] > 0:\n            # a probe stays only where no new order joins its tick: it must sit behind our own size\n            newp = {(a.side, a.price_ticks) for a in out}\n            for o in small:\n                w, k = (wb, kpb) if o.side is Side.BUY else (wa, kpa)\n                if o.price_ticks in w and o.price_ticks not in k and (o.side, o.price_ticks) not in newp:\n                    k.add(o.price_ticks)\n                else:\n                    cancel(o)\n        self.pb = set(kpb)\n        self.pa = set(kpa)\n        if free > 1.0:\n            for t in sorted(wb - kpb):\n                out.append(PlaceOrder(side=Side.BUY, price_ticks=t, quantity=PROBE))\n                self.pb.add(t)\n            for t in sorted(wa - kpa):\n                out.append(PlaceOrder(side=Side.SELL, price_ticks=t, quantity=PROBE))\n                self.pa.add(t)\n        return actions + out\n", "code_sha256": "87f6cc3c4ec37607f7c5f1dab59b480fb16dd2cc9ae08b3be8fe7b10da8ba115", "tried": ["--sandbox fails on Python 3.12.3 for examples/starter_strategy.py and for the final file alike (pathlib imports ntpath, which the sandbox refuses), so the 20-simulation sandbox check could not be done; unsandboxed, the final file has 0 failures on the 1800 simulations run (seeds 0-599, 1000-1599, 30000-30599). The score and holdout fields come from the CLI's JSON, run as six seed ranges side by side and averaged as the simulator's mean_edge does; the search used a harness that calls the same engine and counts cancels, and it reproduced the CLI's 108.6925 on the final file.", "Scorer check: base on seeds 0-599 reproduces 102.33197908899267 exactly. Base on the tuning seeds 1000-1599: 107.2442 (retail 135.80, arb -28.56). Every difference below is paired on seeds 1000-1599 against the build named, mean then standard error.", "Keep every still-wanted probe: 105.98, -1.26 +-0.42 against base (spread 1 -3.46). A kept probe sits ahead of our newer quote on its tick, retail eats it first and the belief reads a crossing. So the probe cancel at a tick our own order joins earns its cost; dropped in this form.", "Leave quotes up to 2 ticks behind when the competitor moves: -3.00 +-0.92 against the 4x build (arb -4.06); up to 3 ticks and 30 shares: -0.97 +-0.17. These left-behind cancels earn the most of any; kept as cancels.", "Cancel an over-target quote only at 2.5x instead of 1.5x: -0.21 +-0.13 against the 4x build (92 instead of 141 such cancels a run). Relax the zero-target cancel to 0.6 of the loss: -0.05 +-0.01. Both kinds earn their cost; kept as cancels.", "Never cancel a queue-ahead order for size: +0.25 +-0.33 against base (retail +1.57, arb -1.32). Relax its zero-target cancel (0.5 of the loss): -0.02 against the 4x build. Dropped.", "Hold the competitor's tick only above a flat share of target, all spreads, 0.3: -1.14 +-1.26 against the 4x build, spread 1 -8.4 +-4.9 with one seed at -658 (1333), so spread 1 is left as the base has it.", "Share of target judged against the front tick's target and the distance to p, all spreads (0.45, 0.7): +0.15 +-1.44, +0.44 +-1.49 against the combined build; spread 1 trimmed mean +0.63 but seed 1333 at -826. Dropped.", "Cap that share at 1.0 or 2.5 mean retail orders: +0.73 +-0.21, +0.72 +-0.17 against the combined build, lower variance than uncapped (+1.07 +-0.39) but lower mean; not kept, see next.", "Keep probes unless a new order of ours joins the tick: 107.22, -0.03 +-0.15, probe cancels 2530 to 662 a run. Kept.", "Keep resting stock bids within 20% of target: 107.17, -0.07 +-0.09, those cancels 103 to 7 a run. Kept.", "Keep a queue-ahead order until Nx over target: 2.5x +0.45 +-0.09, 4x +0.44 +-0.12 (107.68), 7x +0.63 +-0.30. 4x kept; on the final build 2.5x and 7x were -0.16 +-0.13 and -0.27 +-0.27 against it.", "Leave an order one tick behind the quote: +0.025 +-0.003 alone; on the final build removing it costs -0.33 +-0.22. Kept.", "Combined build (probes, stock bids, 4x, one tick behind): 107.62, +0.37 +-0.16 against base, cancels 2973 to 995 a run.", "Flat share on spreads 3-4 only (291 seeds) against the combined build: 0.15 +0.85 +-0.52, 0.2 +1.87 +-0.61, 0.3 +1.95 +-0.58, 0.4 +0.13 +-0.97, 0.6 +0.24 +-1.60. Spread 2 only (165 seeds): 0.15 +1.04 +-0.40, 0.3 +0.78 +-0.86.", "Share scaled by (1-1/spread): 0.35 gives 108.60, 0.45 gives 108.71, 0.4 gives 108.69 (+1.07 +-0.39 against the combined build; spreads 2, 3, 4: +0.28, +1.85, +2.27).", "Share only for spread 1 between 5c and 95c (0.45, 0.9): -0.02 +-0.04, +0.01 +-0.05 against the final build. Cap of 1.0 mean retail orders only below 5c, spreads 2-4: -0.59 +-0.48 (retail -0.97, arb +0.38). Both dropped.", "Measured after the file was frozen, for diagnosis only and not used to choose anything: base on holdout seeds 30000-30599 scores 96.0405 (retail 124.37, arb -28.33); the frozen file is +0.05 +-0.72 against it there (retail +2.18, arb -2.13; median +0.15, 65% of seeds better, mean without the 10 best and 10 worst seeds +0.92). On seeds 0-599, which the base was tuned on, the frozen file scores 103.6539 against 102.3320, +1.32 +-0.31.", "Same diagnosis for the combined build without the share rule: +0.47 +-0.32 on the holdout (96.51), +0.50 +-0.16 on seeds 0-599, +0.37 +-0.16 on the tuning seeds, so the cancel changes alone hold on all three sets. The share rule adds +1.07 and +0.82 on the tuning seeds and seeds 0-599 but -0.41 on the holdout, where three seeds lose 309, 251 and 121 to arbitrage (30291, 30541, 30243) and the mean without the 10 best and 10 worst seeds is +0.52.", "Worst tuning seed for the share rule traced after freezing (1541, spread 2, -141): at step 1461 p jumps from under 1c to 7.4c and takes the 2843-share ask the rule had put in front at tick 2 plus 584 shares at tick 3, for -177.7; without the rule only the 480-share queue-ahead ask stood there and lost 20.9. A guard tried on the tuning seeds only, spreads 2-4, and not adopted: cap the front ask below 5c at 4 or 10 mean retail orders, -0.98 +-0.46 (retail -1.90, arb +0.91) and -0.45 +-0.44.", "Final frozen file: 108.69 on seeds 1000-1599 (tuned on; +1.45 +-0.42 against base, first half +1.23, second half +1.67, 68% of seeds better) and 96.09 on holdout seeds 30000-30599, with 1006 cancels a run against the base's 2973 and no failed simulation."], "next": "Queue place only exists where the competitor has queued behind us, so further cancel-cutting has nothing left to give: over-target, zero-target and left-behind cancels all earn their cost and no seat should spend time removing them. The open question is when to give a queue place up. (1) Fix the tail of the share-of-target rule. Its typical effect is positive on every seed set (mean without the 10 best and 10 worst seeds +0.94, +0.73, +0.52) but a few runs lose 100 to 300 to arbitrage (tuning seeds 1541, 1193; holdout seeds 30291, 30541, 30243) and on the holdout they cancel the gain. In seed 1541 the loss is one upward jump out of the sub-1c regime sweeping the full-size ask (up to qmax 3000 shares) that the rule puts in front, where the build without the rule was only showing its small queue-ahead remnant. Capping that ask's size lost more retail than it saved, so size is not the lever; try timing: use the rule on the ask side only once the estimate has decayed well below 1c (the base's time-below-1c counter), since a jump only reaches a 2c or 3c ask from close to 1c, and check the three holdout seeds for the same pattern. A seat that only wants the safe part can set maf=0: that build is +0.37 to +0.50 over base on all three seed sets. (2) Spread 1 is untouched: the same rule there had a positive trimmed mean (+0.63) but one seed lost 658 to 826 depending on the form of the rule (seed 1333; with the flat rule its arb loss went from 61 to 719); trace it before trying again. (3) Probes ahead of our own size cost 1.26 a run through false crossings. The base can still read a false crossing when p moves a tick and a retail order eats the surviving probe in the same step; buy_filled_quantity and sell_filled_quantity can tell a retail sweep from a crossing."}