{"key":"f6-rival-mid-shift","mechanism":"f6-rival-mid-shift","spreads_acted":[1,4],"approach":"Overlay on MA: track the rival (competitor) best bid/ask each step; when both are present before and after and the mid moves by m whole ticks (m = trunc(delta(bid+ask)/2)), cancel each own resting order that MA's actions this step left in place and re-place it at price+m with the same remaining quantity, dropping any that would cross the rival or leave 1..99. MA's fresh PlaceOrders are not shifted; if MA sends CancelAll nothing is added. A conservative collateral budget skips a re-place that could fail. Active only when s=max(1,(ask-bid+1)//2) from the first rival quotes is 1 or 4.","tried":"Three variants on T=340200..340399 (97 target-spread seeds): all orders -10.77 (se 1.91); away side only (bids when rival mid rose, asks when it fell) -10.53 (se 1.90); all orders only when |m|>=2 -0.37 (se 0.32). Froze |m|>=2. Holdout H=450000..450499: target spreads -0.354 (se 0.389, n=246); all 500 seeds -0.174.","next":"Do not promote. Shifting resting quotes along with the rival mid loses mainly through 1-tick moves (in tuning, variant all at s=4: retail -5.59, arb -8.79 per seed; s=1: retail -3.85, arb -4.04), and gains nothing at |m|>=2, so the rival mid's step is a poor proxy for the probability move at these spreads. A next idea could shift only away from danger (pull quotes back) instead of chasing, or use the rival's swept depth as a jump signal for widening.","overlay_code":"_IncumbentStrategy = Strategy\n\n\nclass Strategy(_IncumbentStrategy):\n    # f6-rival-mid-shift overlay: when the rival mid moves by m whole ticks in one\n    # step, re-place own resting orders shifted by m ticks (same quantity).\n    _F6_MODE = \"big\"  # \"all\", \"away\" or \"big\"\n\n    def __init__(self):\n        super().__init__()\n        self._f6_s = None\n        self._f6_prev = None\n\n    def on_step(self, state):\n        from orderbook_pm_challenge.types import CancelAll as _CA, CancelOrder as _CO, PlaceOrder as _PO, Side as _Side\n\n        actions = list(super().on_step(state) or [])\n        bid = state.competitor_best_bid_ticks\n        ask = state.competitor_best_ask_ticks\n        if self._f6_s is None:\n            if bid is not None and ask is not None:\n                self._f6_s = max(1, (ask - bid + 1) // 2)\n            else:\n                self._f6_s = 0\n        prev = self._f6_prev\n        self._f6_prev = (bid, ask) if (bid is not None and ask is not None) else None\n        if self._f6_s not in (1, 4) or prev is None or self._f6_prev is None:\n            return actions\n        dsum = (bid + ask) - (prev[0] + prev[1])\n        m = int(dsum / 2)  # whole ticks, truncated toward zero\n        if m == 0:\n            return actions\n        mode = self._F6_MODE\n        if mode == \"big\" and abs(m) < 2:\n            return actions\n        if any(isinstance(a, _CA) for a in actions):\n            return actions\n        cancelled = set(a.order_id for a in actions if isinstance(a, _CO))\n        # conservative collateral budget after the incumbent's own actions\n        budget = float(state.free_cash)\n        for a in actions:\n            if isinstance(a, _PO):\n                p = a.price_ticks / 100.0\n                budget -= (p if a.side == _Side.BUY else 1.0 - p) * float(a.quantity)\n        for o in state.own_orders:\n            if o.order_id in cancelled and o.side == _Side.BUY:\n                budget += o.price_ticks / 100.0 * o.remaining_quantity\n        extra = []\n        for o in state.own_orders:\n            if o.order_id in cancelled:\n                continue\n            if mode == \"away\":\n                # the side the rival moved away from: bids when it moved up, asks when down\n                if (m > 0) != (o.side == _Side.BUY):\n                    continue\n            q = o.remaining_quantity\n            if q < 0.01:\n                continue\n            newp = o.price_ticks + m\n            ok = 1 <= newp <= 99\n            if ok and o.side == _Side.BUY and newp >= ask:\n                ok = False\n            if ok and o.side == _Side.SELL and newp <= bid:\n                ok = False\n            extra.append(_CO(o.order_id))\n            if o.side == _Side.BUY:\n                budget += o.price_ticks / 100.0 * q\n            if not ok:\n                continue\n            np_ = newp / 100.0\n            need = (np_ if o.side == _Side.BUY else 1.0 - np_) * q\n            if need + 1e-6 > budget:\n                continue\n            budget -= need\n            extra.append(_PO(side=o.side, price_ticks=newp, quantity=q))\n        return actions + extra\n","overlay_sha256":"105ade7c0a13d524f6845f68468fad05f05fb0872f92f09aa18b045aae13f0ec","code_sha256":"06cdd2e86b751106e8f9416dac6289809cfef7fe6ef6e461d5798bdb880f8377","base_sha256":"5d1bd5272884f513b19f0e66a7c235f6c188a08e4f7787ac9346f1614dda3ed3","check_values":{"310000":17.116002,"310001":23.820392,"310002":2.376144,"310003":243.87214},"python_version":"3.12.3","tuning":{"seeds":"340200..340399","variants":[{"name":"all","code_sha256":"f5ef484f50a73a4dfd00e183806562c5b404b40cb1c90f224969356bb83b7292","mean_diff":-10.768675,"se":1.911962,"by_spread":{"1":{"n":54,"mean_diff":-7.888698,"se":2.463393},"4":{"n":43,"mean_diff":-14.38539,"se":2.944963}},"all_seeds_mean_diff":-5.222807},{"name":"away","code_sha256":"8464ed05f25e8e7a6312eff2ce4af2e7feaf4a3ea0c990d69cdb965449d9b24b","mean_diff":-10.534406,"se":1.898608,"by_spread":{"1":{"n":54,"mean_diff":-7.467881,"se":2.419818},"4":{"n":43,"mean_diff":-14.38539,"se":2.944963}},"all_seeds_mean_diff":-5.109187},{"name":"big","code_sha256":"06cdd2e86b751106e8f9416dac6289809cfef7fe6ef6e461d5798bdb880f8377","mean_diff":-0.369296,"se":0.315251,"by_spread":{"1":{"n":54,"mean_diff":-0.509626,"se":0.495365},"4":{"n":43,"mean_diff":-0.193066,"se":0.349627}},"all_seeds_mean_diff":-0.179108}],"selected":"big"},"paired":{"seeds":"450000..450499","n":500,"complete":true,"missing_seeds":[],"failures":[],"overall":{"n":500,"sum_d":-87.130827,"sum_d2":9166.978872,"mean_diff":-0.174262,"se":0.191522,"base_mean":106.779925,"retail_diff":-0.119293,"arb_diff":-0.054969},"target_spreads_1_4":{"n":246,"sum_d":-87.130827,"sum_d2":9166.978872,"mean_diff":-0.35419,"se":0.389341,"base_mean":104.586269,"retail_diff":-0.242466,"arb_diff":-0.111725},"by_spread":{"1":{"n":124,"sum_d":-102.641433,"sum_d2":3420.578543,"mean_diff":-0.827753,"se":0.467654,"base_mean":52.178154,"retail_diff":-0.684787,"arb_diff":-0.142966},"2":{"n":143,"sum_d":0.0,"sum_d2":0.0,"mean_diff":0.0,"se":0.0,"base_mean":88.61321,"retail_diff":0.0,"arb_diff":0.0},"3":{"n":111,"sum_d":0.0,"sum_d2":0.0,"mean_diff":0.0,"se":0.0,"base_mean":135.045509,"retail_diff":0.0,"arb_diff":0.0},"4":{"n":122,"sum_d":15.510606,"sum_d2":5746.400329,"mean_diff":0.127136,"se":0.623808,"base_mean":157.853533,"retail_diff":0.207107,"arb_diff":-0.079971}},"off_target_zero":true,"per_seed":[[450000,1,0.192563],[450001,1,0.0],[450002,3,0.0],[450003,1,0.0],[450004,1,0.012692],[450005,1,0.120302],[450006,1,0.0],[450007,1,0.0],[450008,4,0.203043],[450009,1,-3.179447],[450010,2,0.0],[450011,4,-1.978014],[450012,2,0.0],[450013,1,0.0],[450014,2,0.0],[450015,1,-0.21136],[450016,2,0.0],[450017,2,0.0],[450018,2,0.0],[450019,4,-32.396293],[450020,3,0.0],[450021,2,0.0],[450022,3,0.0],[450023,4,-0.072515],[450024,2,0.0],[450025,2,0.0],[450026,1,0.0],[450027,4,-1.467463],[450028,2,0.0],[450029,4,-2.960849],[450030,1,-0.018315],[450031,4,0.0],[450032,1,-0.060401],[450033,4,-0.336897],[450034,4,-0.009602],[450035,4,0.0],[450036,1,-0.449253],[450037,4,-0.181308],[450038,2,0.0],[450039,3,0.0],[450040,2,0.0],[450041,2,0.0],[450042,4,-1.561814],[450043,2,0.0],[450044,4,-0.195858],[450045,4,-0.232849],[450046,1,-0.309498],[450047,1,-0.00497],[450048,2,0.0],[450049,3,0.0],[450050,2,0.0],[450051,2,0.0],[450052,1,0.0],[450053,3,0.0],[450054,3,0.0],[450055,2,0.0],[450056,1,0.0],[450057,2,0.0],[450058,1,0.0],[450059,2,0.0],[450060,3,0.0],[450061,3,0.0],[450062,2,0.0],[450063,1,-0.002293],[450064,3,0.0],[450065,1,0.0],[450066,4,1.979347],[450067,3,0.0],[450068,3,0.0],[450069,4,1.548865],[450070,3,0.0],[450071,3,0.0],[450072,1,-0.095751],[450073,1,0.991707],[450074,3,0.0],[450075,4,1.527129],[450076,1,-0.189516],[450077,1,0.0],[450078,4,-1.212865],[450079,1,0.013984],[450080,2,0.0],[450081,2,0.0],[450082,4,-0.470242],[450083,3,0.0],[450084,3,0.0],[450085,4,1.915839],[450086,1,-0.073347],[450087,2,0.0],[450088,2,0.0],[450089,2,0.0],[450090,1,0.0],[450091,4,0.0],[450092,4,1.112511],[450093,1,-0.279827],[450094,1,-0.004118],[450095,2,0.0],[450096,3,0.0],[450097,4,-0.801947],[450098,3,0.0],[450099,3,0.0],[450100,4,0.0],[450101,1,0.0],[450102,1,-0.024538],[450103,3,0.0],[450104,2,0.0],[450105,1,0.0],[450106,1,-9.446104],[450107,1,-0.00032],[450108,2,0.0],[450109,2,0.0],[450110,3,0.0],[450111,2,0.0],[450112,1,-0.486206],[450113,1,-0.01425],[450114,4,-0.723301],[450115,3,0.0],[450116,1,0.0],[450117,1,0.0],[450118,2,0.0],[450119,2,0.0],[450120,4,0.0],[450121,3,0.0],[450122,2,0.0],[450123,2,0.0],[450124,1,0.160802],[450125,3,0.0],[450126,1,-0.10245],[450127,4,0.10577],[450128,4,-0.004472],[450129,2,0.0],[450130,4,-0.041387],[450131,4,-0.433513],[450132,1,0.0],[450133,2,0.0],[450134,3,0.0],[450135,4,0.258644],[450136,4,-0.592145],[450137,4,-0.647223],[450138,2,0.0],[450139,2,0.0],[450140,3,0.0],[450141,1,-9.933576],[450142,1,0.0],[450143,2,0.0],[450144,2,0.0],[450145,1,-0.006151],[450146,2,0.0],[450147,2,0.0],[450148,2,0.0],[450149,2,0.0],[450150,3,0.0],[450151,2,0.0],[450152,4,0.0],[450153,1,0.006324],[450154,4,-0.076015],[450155,2,0.0],[450156,4,0.0],[450157,4,-1.564164],[450158,1,-0.095931],[450159,4,-2.176384],[450160,3,0.0],[450161,2,0.0],[450162,2,0.0],[450163,2,0.0],[450164,3,0.0],[450165,3,0.0],[450166,2,0.0],[450167,1,0.0],[450168,2,0.0],[450169,4,0.208684],[450170,4,-0.249043],[450171,1,-0.006722],[450172,4,-0.636773],[450173,1,0.0],[450174,4,0.836072],[450175,4,0.097529],[450176,1,0.0],[450177,4,-0.336198],[450178,2,0.0],[450179,4,0.0],[450180,4,-0.503046],[450181,2,0.0],[450182,2,0.0],[450183,2,0.0],[450184,2,0.0],[450185,4,0.0],[450186,1,0.0],[450187,1,0.0],[450188,4,1.458949],[450189,2,0.0],[450190,4,0.0301],[450191,3,0.0],[450192,3,0.0],[450193,4,2.505688],[450194,4,-0.008234],[450195,3,0.0],[450196,4,1.137208],[450197,1,0.0],[450198,2,0.0],[450199,3,0.0],[450200,1,-0.007144],[450201,1,0.0],[450202,1,-0.01827],[450203,1,0.0],[450204,4,-0.536089],[450205,3,0.0],[450206,3,0.0],[450207,4,0.138511],[450208,4,-0.179018],[450209,1,-0.255125],[450210,3,0.0],[450211,2,0.0],[450212,2,0.0],[450213,2,0.0],[450214,1,-0.091068],[450215,2,0.0],[450216,1,3.138553],[450217,3,0.0],[450218,3,0.0],[450219,1,0.064428],[450220,1,0.0],[450221,1,-0.066605],[450222,1,-0.260177],[450223,2,0.0],[450224,1,0.0],[450225,1,0.019418],[450226,4,-0.651149],[450227,1,-0.906574],[450228,4,-2.12597],[450229,2,0.0],[450230,3,0.0],[450231,4,-0.098706],[450232,1,-0.197393],[450233,4,-0.148323],[450234,1,-3.218489],[450235,3,0.0],[450236,3,0.0],[450237,3,0.0],[450238,4,-12.820332],[450239,1,0.0],[450240,1,0.052487],[450241,3,0.0],[450242,4,0.0],[450243,2,0.0],[450244,1,-8.016236],[450245,1,0.0],[450246,3,0.0],[450247,1,0.245177],[450248,4,0.0],[450249,2,0.0],[450250,4,0.0],[450251,1,-0.034503],[450252,2,0.0],[450253,4,-0.237534],[450254,2,0.0],[450255,2,0.0],[450256,2,0.0],[450257,2,0.0],[450258,2,0.0],[450259,4,1.68407],[450260,1,0.213165],[450261,1,-0.064935],[450262,1,0.0],[450263,4,0.0],[450264,1,-0.159548],[450265,4,-1.555321],[450266,3,0.0],[450267,3,0.0],[450268,3,0.0],[450269,2,0.0],[450270,4,-0.507901],[450271,2,0.0],[450272,2,0.0],[450273,2,0.0],[450274,2,0.0],[450275,4,-0.58437],[450276,3,0.0],[450277,4,-1.432789],[450278,3,0.0],[450279,2,0.0],[450280,1,0.0],[450281,3,0.0],[450282,3,0.0],[450283,3,0.0],[450284,2,0.0],[450285,1,0.0],[450286,2,0.0],[450287,3,0.0],[450288,4,-0.29823],[450289,3,0.0],[450290,4,0.0],[450291,3,0.0],[450292,2,0.0],[450293,3,0.0],[450294,2,0.0],[450295,4,-3.472998],[450296,2,0.0],[450297,4,0.629402],[450298,4,22.70522],[450299,3,0.0],[450300,1,0.0],[450301,2,0.0],[450302,1,0.000415],[450303,4,-0.485916],[450304,3,0.0],[450305,1,0.0],[450306,4,-1.457184],[450307,3,0.0],[450308,4,-1.415041],[450309,2,0.0],[450310,4,0.0],[450311,1,0.0],[450312,4,-0.175809],[450313,2,0.0],[450314,3,0.0],[450315,4,-2.481587],[450316,3,0.0],[450317,2,0.0],[450318,4,0.0],[450319,3,0.0],[450320,3,0.0],[450321,3,0.0],[450322,1,-55.184525],[450323,2,0.0],[450324,3,0.0],[450325,2,0.0],[450326,4,0.0],[450327,1,0.0],[450328,2,0.0],[450329,4,-0.68829],[450330,3,0.0],[450331,3,0.0],[450332,2,0.0],[450333,1,-0.0093],[450334,4,-0.01429],[450335,1,-0.173514],[450336,3,0.0],[450337,3,0.0],[450338,2,0.0],[450339,4,-0.128705],[450340,2,0.0],[450341,2,0.0],[450342,2,0.0],[450343,1,-0.280511],[450344,3,0.0],[450345,2,0.0],[450346,3,0.0],[450347,3,0.0],[450348,4,12.398192],[450349,2,0.0],[450350,2,0.0],[450351,2,0.0],[450352,3,0.0],[450353,3,0.0],[450354,2,0.0],[450355,4,0.342132],[450356,1,0.0],[450357,3,0.0],[450358,1,0.0],[450359,2,0.0],[450360,2,0.0],[450361,3,0.0],[450362,2,0.0],[450363,2,0.0],[450364,2,0.0],[450365,2,0.0],[450366,2,0.0],[450367,4,-2.013518],[450368,2,0.0],[450369,3,0.0],[450370,2,0.0],[450371,2,0.0],[450372,4,-1.754641],[450373,2,0.0],[450374,3,0.0],[450375,3,0.0],[450376,3,0.0],[450377,3,0.0],[450378,1,0.0],[450379,3,0.0],[450380,4,-0.023311],[450381,1,0.111257],[450382,2,0.0],[450383,2,0.0],[450384,1,0.0],[450385,1,0.0],[450386,4,0.0],[450387,1,0.0],[450388,4,-0.380776],[450389,1,0.0],[450390,1,0.0],[450391,4,-1.450512],[450392,1,0.0],[450393,4,3.844409],[450394,3,0.0],[450395,1,0.0],[450396,3,0.0],[450397,3,0.0],[450398,2,0.0],[450399,2,0.0],[450400,4,0.296804],[450401,3,0.0],[450402,3,0.0],[450403,3,0.0],[450404,4,-0.02647],[450405,4,2.177039],[450406,3,0.0],[450407,2,0.0],[450408,4,1.544771],[450409,1,0.0],[450410,2,0.0],[450411,2,0.0],[450412,3,0.0],[450413,1,0.0],[450414,1,-0.028633],[450415,4,0.0],[450416,1,0.0],[450417,1,0.0],[450418,2,0.0],[450419,3,0.0],[450420,2,0.0],[450421,2,0.0],[450422,2,0.0],[450423,2,0.0],[450424,2,0.0],[450425,2,0.0],[450426,3,0.0],[450427,1,-0.005033],[450428,2,0.0],[450429,2,0.0],[450430,3,0.0],[450431,2,0.0],[450432,3,0.0],[450433,4,-2.205236],[450434,1,-0.04294],[450435,1,-0.003003],[450436,4,0.350684],[450437,3,0.0],[450438,2,0.0],[450439,1,0.0],[450440,4,1.533983],[450441,3,0.0],[450442,4,0.0],[450443,4,0.001897],[450444,2,0.0],[450445,4,0.05328],[450446,2,0.0],[450447,1,-0.017959],[450448,2,0.0],[450449,2,0.0],[450450,1,-8.765253],[450451,4,0.144626],[450452,1,0.001476],[450453,4,0.0],[450454,4,-0.527498],[450455,3,0.0],[450456,2,0.0],[450457,1,0.031298],[450458,4,0.0],[450459,3,0.0],[450460,4,0.39442],[450461,2,0.0],[450462,3,0.0],[450463,3,0.0],[450464,1,-0.006818],[450465,1,0.0],[450466,1,0.0],[450467,3,0.0],[450468,2,0.0],[450469,1,-0.029853],[450470,1,-0.135483],[450471,4,0.0],[450472,1,0.0],[450473,2,0.0],[450474,4,0.0],[450475,4,-15.692062],[450476,4,-0.57322],[450477,1,0.021249],[450478,4,0.083002],[450479,4,0.724658],[450480,3,0.0],[450481,4,0.260834],[450482,2,0.0],[450483,3,0.0],[450484,3,0.0],[450485,3,0.0],[450486,2,0.0],[450487,4,0.0],[450488,2,0.0],[450489,3,0.0],[450490,2,0.0],[450491,1,-2.621396],[450492,1,-2.444096],[450493,4,0.244715],[450494,3,0.0],[450495,3,0.0],[450496,3,0.0],[450497,4,59.04579],[450498,2,0.0],[450499,4,0.0]]},"worst_seeds":[[450322,1,-55.184525],[450019,4,-32.396293],[450475,4,-15.692062],[450238,4,-12.820332],[450141,1,-9.933576]],"notes":"Simulator danrobinson/prediction-market-challenge @ b244530e, unmodified, defaults, single process, no --sandbox/--workers; per seed sample_config + SimulationEngine(config, factory, seed) for MA and candidate. MA fetched by script, SHA-256 verified, source never viewed. Check values match the brief. s from first rival quotes equalled config spread_ticks on every seed run. mean_diff/se in tuning variants are over target spreads (1,4). Interpretation choices: half-tick mid moves count as m=0; only orders MA left resting are shifted; 'side moved away from' = bids when the rival mid moved up, asks when it moved down. No failures; off-target d exactly 0. Holdout result is not a gain: -0.354 +/- 0.389 on spreads 1 and 4."}