CHRONOS

Software · Trading platform

CHRONOS 交易控制台

Every ten minutes, a machine-learning model reads the live order book, predicts what each traded lot will earn, and sets how much the desk quotes. Shuo built it from scratch, and its central finding changed how the desk sizes.

  • Conceived, designed and built by Shuo Huang
  • From scratch, self-initiated
  • Built for live-hog market making
  • First live Sep 2026
  • Research to closed loop in 3 weeks
  • 46 versions in 23 days
  • Retrains itself after every trading day’s close
  • 43 self-tests on the final release

01System architecture

A closed loop around a live high-frequency engine.

CHRONOS never places an order. It reads everything from the trading engine’s own log, with sub-second lag,1 and acts only by changing three values in the engine’s live configuration file, which other programs and traders also edit.

Trading machine · desk IT’s system

HFT engine

Quotes and trades live hog. Applies a new size to every new order it places.

The only input

Engine log, tailed live

Every five-level snapshot, fill, position, P&L print and parameter change.

After the close

Day bundle

Logs, decisions, writes and model files, bundled for research.

Every minute

Features and model

Nine inputs from the book, trade flow, inventory and clock; predicts what a filled lot earns over the next 5 seconds.

After every close

Self-retraining

Re-fits from the day’s log, one model per quoting strategy. Gated, backed up, hot-reloaded.

Every 10 minutes

Sizing policy

Three bands set the size; depth, inventory and exchange-limit valves can only cut it.

Every second

Loss brake

A short and a longer loss window on the engine’s own P&L: cancel all quotes, cut size, restart.

Armed contracts only

Guarded writer

Changes value bytes only. Re-checks the file, replaces it atomically, reads it back byte for byte.

Always in command

Trader

Arms each contract, takes over by typing a size, starts a strategy switch, hits emergency stop.

Shared with other writers

Engine configuration file

The engine’s live configuration: quote size, quoted levels, strategy state.

Simplified: the loss brake and the re-fit also read the engine log; the brake, the strategy switch and the trader’s buttons write strategy state through the same guarded writer.

Why the engine’s log is the feed

Shuo measured it before trusting it: 16,575 of 16,575 order-book snapshots in the log were identical to the exchange’s own multicast feed. The log also carries what no market feed has: the desk’s fills, position, P&L and every parameter.

Why a file and not an order

The engine already re-reads its configuration file while running. Writing three values there needs no change to desk IT’s engine, leaves an audit trail of every decision, and lets a trader override with the same tool they always use.

Why size never reaches zero

A designated market maker must keep a minimum size resting on both sides, within a maximum spread, for a minimum share of each month’s trading time, and the engine tops resting quotes up to that minimum.2 So CHRONOS decides how much to quote, never whether to quote, and stopping is left to the loss brake.

02The story

From a dial turned by hand to a closed loop that retrains itself.

A market maker stands in the market all day offering to buy and to sell, and earns a small margin on each trade. The dial that matters most is how much to offer at a time, counted in lots (contracts), and on the desk that dial was turned by hand.

On his own initiative Shuo measured what that dial really does on the desk’s own fills, with no simulator, turned the answer into a machine-learning system, and wired it into the live trading engine for live-hog market making. Nine days after the research began, he was trading by its numbers. Twelve days later it was setting them itself. Its brake stops and restarts quoting within seconds when losses build.

Its central finding changed how the desk sizes: profit per lot holds up as size grows, and the desk scaled its live-hog quoting size several-fold on it.3

  1. 01

    The problem: the most important dial was turned by hand

    Live hog on the Dalian Commodity Exchange is one of the six products Shuo makes markets in. The desk’s high-frequency engine quotes on its own, but one setting decides how much money is at work: the number of lots (contracts) in each quote it leaves resting in the market. Traders changed it by hand, many times a day.

    • Nobody had measured what a size change does: how many more lots trade, or whether profit per lot falls as size grows.
    • A simulator could not answer it: a snapshot-based simulator misses a size-dependent share of actual fills, so it cannot measure a size effect.
    • Nothing read the engine’s state live, so no tool could react faster than a person.
  2. 02

    What Shuo built: a machine that turns the dial itself

    Picture a stall-holder who decides every ten minutes how much stock to put on the counter. CHRONOS watches how busy the street is and how deep the crowd, puts more out when each sale is likely to be a good one, less when it is not, and pulls the shutter down within seconds if the till starts to bleed. Shuo conceived, designed and built it independently, end to end:

    • The measurement. On the desk’s own fill records from several months of trading, with no simulator: quoting bigger brings in a little less than proportionally more volume, and the profit on each lot does not shrink.3 The question “what size?” became “which ten minutes deserve the size?”
    • The model. A self-retraining machine-learning model chosen in a walk-forward tournament of about 20 models, including gradient-boosted decision trees (a custom LightGBM-style histogram booster he wrote from scratch), ridge regressions and ensembles, on inputs first audited for look-ahead. The top models tied on out-of-sample money, so the simplest of them shipped,4 and it re-fits itself every trading day.
    • The loop. Every 10 minutes it scores the coming window from the live order book and recent trading, and writes the quote size straight into the live engine. A loss brake checks the engine’s running profit and loss every second and, on its own, cancels every resting quote, cuts the size and restarts once the engine confirms. The trader can take over by typing a number.

    He began the research on Aug 25, 2026. Nine days later CHRONOS was live in recommend-only mode, with him trading by its numbers, and twelve days after that it closed the loop. By Sep 24 it had shipped 46 versions in 23 days,5 most of them while it ran live on the desk.

  3. 03

    What changed: the desk scaled its quotes several-fold

    Shuo’s research showed that profit per lot holds up as size grows, and the desk scaled its live-hog quoting size several-fold on it.3

    Tested walk-forward on months of trading days it had never seen, the model beat hand sizing out of sample at equal volume.4 Live, once its recommendations began to vary, larger sizes went with higher profit per lot on every live day checked.6 Every period was rebuilt from the engine’s own log and reconciled to the desk’s settlement records. On the first closed-loop day he questioned its calls, re-scored every window on realized profit and loss, and shipped a better sizing rule that same night.

    CHRONOS is switched on today for contracts quoted at a steady size through the day.7 Its seconds-scale loss windows now run on every trading machine through Strategy One’s automatic stops, and its signed self-updating launcher ships inside Position Atlas.

Several-fold

how far the desk scaled its live-hog quoting size on the study’s central finding3

20models

in a walk-forward tournament on months of unseen trading days, including one look-ahead control; the simplest of the tied leaders shipped4

3weeks

from the first research question to a closed loop writing sizes into the live engine

46versions

shipped in 23 days, from first console to signed self-updating executable5

16,575 / 16,575

order-book snapshots in the engine’s log identical to the exchange’s own feed1

43self-tests

on the final release, plus a 42-check end-to-end run of the signed update path8

03Evidence

What changed when CHRONOS sized the quotes.

The pattern of the live record, drawn from synthetic data: weak and mixed while size was set by hand, positive on every day once CHRONOS set it. The desk’s own figures are confidential.9

Quote size against profit per lot, day by day

Under hand sizing the link between size and profit per lot was weak and mixed; with CHRONOS it was positive on every day.

Show the dataHide the data
Data: Quote size against profit per lot, day by day
Trading day (illustrative)Daily correlation
1−0.54
20.17
30.23
4−0.90
5−0.20
6−0.25
70.69
8−0.26
90.59
100.24
110.65
120.46
130.13
140.29
15−0.11
16−0.64
170.44
180.51
190.45
200.42
210.47
220.47
230.61
240.58
250.46
260.47
270.59
280.53
Synthetic data. Illustrative values, generated to show the pattern of the live record: 16 days of hand sizing scattered around zero, then 12 days of CHRONOS sizing, every one above it. The measure is as built: each day’s volume-weighted correlation between quote size and profit per lot across its constant-size periods, rebuilt from the engine’s own log and reconciled to settlement records. A correlation, not an experiment. The desk’s own figures are confidential.6

04Functions

What it does, in the order a trader meets it.

A

Command the desk’s quoting from one screen

One tile per contract shows the size CHRONOS wants, why, and what the engine is doing right now.

  • One decision per contract every 10 minutes, about 20 a day
  • Per-contract arming: controlled, or watch-only
  • Master switch, dry run and a red emergency stop
English redraw of the CHRONOS command center on synthetic data: a header with start and emergency-stop buttons, four status cards, three master switches, a contract tile recommending 40 lots in the top band above a strip of per-minute model scores, and a second, watch-only tile. Enlarge
Synthetic data. The trader’s view, redrawn in English on generated inputs; the desk’s own interface is in Chinese.9 The large violet number is the quote size CHRONOS recommends for the contract; the second tile is a watch-only contract waiting for its first quote.
  1. Marker 1: Emergency stop (top right): CHRONOS keeps reading but writes nothing, and can stop every controlled strategy.
  2. Marker 2: Status cards: contracts followed, contracts under control, time to the next 10-minute decision and writes this session.
  3. Marker 3: Master switches: closed-loop writing and recommendations switch separately, so CHRONOS can run recommend-only; dry run writes nothing.
  4. Marker 4: Recommended quote size: 40 lots, top band, quoted on one price level.
  5. Marker 5: The derivation in one line: base size, the score’s percentile against the day’s band lines, band multiplier, liquidity cap and position against the risk cap.
  6. Marker 6: Score history: one bar per recent minute; bright bars scored at or above the top-band line, outlined bars started a 10-minute window.
  7. Marker 7: Watch-only (top right of the second tile): the contract is not armed, so CHRONOS only recommends.

B

Read the five-level order book

Every snapshot of the top five bids and offers arrives from the engine’s own log, identical to the exchange feed.

  • Five-level depth, best-level imbalance and spread feed the model directly
  • Trailing 30-second volume, volatility and price move come from the same stream
  • 16,575 of 16,575 snapshots matched the exchange multicast1
English redraw of the CHRONOS order-book view on synthetic data: five ask levels above five bid levels, each with a price on the contract’s 5-yuan tick grid and the lots resting, a strip of mid price, spread, imbalance and depth between them, and a panel of trailing 30-second statistics on the right. Enlarge
Synthetic data. What CHRONOS reads, redrawn in English on a generated book at a fictitious price level:9 the five best offers above the five best bids with the lots resting at each, and beside them the trailing 30-second statistics. Eight of the model’s nine inputs are on this one screen.
  1. Marker 1: Five ask levels: price and lots resting at each; the bar shows the depth. The five bid levels mirror them below.
  2. Marker 2: Best offer and best bid (highlighted rows): when other traders’ lots at the best level fall under a thin-book line, a valve forces the quote to the minimum size.
  3. Marker 3: Book inputs: mid price, spread, best-level imbalance and five-level depth on each side.
  4. Marker 4: Flow inputs: trailing 30-second market volume, mid-price move and realized volatility.
  5. Marker 5: Clock and inventory: time of day and inventory in units of the quote size complete the inputs.

C

Size every window by its score

The model’s score at the first minute of each 10-minute window, ranked against a trailing window of recent trading days, puts the window in one of three bands, and the band sets the size.

  • Top-band windows quote the full base size; the middle and bottom bands quote fixed fractions of it
  • Order-book depth can cap the number; a thin book, a large inventory or the exchange position limit forces the minimum size
  • Each tile shows its own arithmetic: the score’s rank, the band, the multiple and the caps that apply
English redraw of three CHRONOS decisions on synthetic data, one per band: a top-band tile recommending 40 lots, a middle-band tile recommending 30 and a bottom-band tile recommending 10, each listing its base size, score percentile, band multiplier, liquidity cap, position and the number of price levels quoted. Enlarge
Synthetic data. One decision in each band, with its arithmetic, redrawn in English on generated inputs.9 The base size, band shares, multipliers and caps here are illustrative: an illustrative base of 40 lots gives 40, 30 and 10. The desk’s settings are not published.

D

Write straight into the live engine, safely

For armed contracts CHRONOS writes the size, the number of quoted levels and the strategy state into the engine’s live configuration file.

  • Changes only the value bytes; re-checks the file, replaces it atomically and reads it back byte for byte
  • Shares the file with Strategy One and traders editing by hand, and refuses a file it cannot parse safely
  • A write counts as done only when the engine’s own log shows the new values

E

Stop and restart quoting on its own, in seconds

A two-layer loss brake watches the engine’s running profit and loss every second and acts without waiting for anyone.

  • Two loss windows, a short one and a longer one, because a price burst does its damage within seconds to a minute, faster than a periodic check or a person
  • Cancels every resting quote, cuts the size, waits for the engine’s acknowledgment, then restarts
  • Suggestions from the desk, built in: a position buffer holds the brake back while the position is large relative to the quote size, and a stop-and-flatten variant handles a large position

F

Keep the trader in command

A person can overrule the model at any moment, and CHRONOS notices without being told.

  • Typing a size by hand pauses CHRONOS’s size writes; the brake stays armed
  • “Resume auto” lifts the hold and writes the model’s size back at once
  • One confirmed click switches a contract between the desk’s two quoting strategies: stop, wait for the engine’s acknowledgment and a flat position, start the other

G

Retrain itself every trading day

After every trading day’s close, the trading machine re-fits the model from that day’s engine log.

  • One model per quoting strategy; every minute is tagged with the strategy that actually ran
  • Six acceptance gates; a failed gate keeps yesterday’s file and says why on screen
  • A full day of logs, 2.44 million lines, is parsed in 4.2 seconds; the training set grows with every trading day

H

Ship to a locked-down trading machine

The trading machines are locked down by design, with nothing installed, so CHRONOS ships as one signed executable that updates itself.

  • Signature-pinned, password-gated updates; a new build that crashes is rolled back in 8 seconds and blocklisted
  • 43 self-tests on the machine itself, plus a 42-check end-to-end run8
  • A complete diagnostic bundle of every trading day for research, collected by the log pipeline

05How it works

The decision, the model, and the finding the desk acted on.

Three animated figures: how one decision is made, how the model was chosen, and what the data said about size.

One decision, start to finish

How CHRONOS decides

Synthetic data. Mechanism as built; every number in this figure is illustrative. As built: a decision every 10 minutes; a nine-input, lots-weighted least-squares model that predicts the value of a fill, per lot, about five seconds after it trades; three bands recomputed daily from a trailing window of the same strategy’s trading days; five valves in a fixed order; the minimum resting size of the market-making obligation and the engine’s automatic top-up; a loss brake on a short and a longer window with its cancel, acknowledge, restart cycle; the takeover, “resume auto” and strategy-switch rules; the guarded write; and which inputs carry the signal (five-level depth, recent volume and time of day), with the daily re-fit. Illustrative: every size, band share, threshold and window length, the book depths, the input bars, the percentile ranks, the clock times and the order of bands through the session. No prices, profit figures or desk settings are shown.

Text description of this figure

Three panels, read left to right, above a strip of one trading session. Every number is illustrative. Panel one is a live-hog order book: five ask and five bid levels, other traders’ lots drawn as dots and the desk’s own resting lots as chips. The best two levels on each side are hatched because the market-making obligation needs a minimum size resting near the best prices, drawn here as 4 lots, which the trading engine tops up automatically. Panel two is the model: nine inputs (five-level depth, recent volume, time of day, spread, book imbalance, volatility, recent price move, inventory relative to size, and order size) go through a lots-weighted least-squares regression that predicts what a filled lot will be worth about five seconds later. The window’s score is ranked against the trailing 20 trading days: here the top 40% of windows is the top band, the bottom 30% the bottom band, the rest the middle. Deeper books, busier markets and later hours score higher, and the model re-fits itself every trading day. Panel three turns the band into a size, here 40, 30 or 10 lots, then runs five valves in order: a liquidity cap from recent depth; other traders’ best level under 15 lots forces 1 lot; inventory over a threshold forces 1 lot; the exchange position limit forces 1 lot; and the loss brake. Every write goes to armed contracts only, is rate-limited, and is read back byte for byte. Six scenarios play in turn. A strong window ranks in the top band and gets 40 lots on one price level. An average window gets 30 lots on two levels. A weak window gets 10 lots on three levels, still above the 4-lot floor; stopping instead would earn no qualifying quote time. In a thin book, with only 8 and 7 lots from other traders at the best prices, the liquidity cap cuts 10 lots to 3 and the thin-book valve forces 1 lot; the engine adds a 3-lot top-up at the second level, so 4 lots still rest per side. When the change in profit and loss over the last 40 seconds (also checked over 80 seconds) trips the loss brake, CHRONOS puts the strategy in cancel-only with a reduced size of 1 lot, waits for the engine’s acknowledgment and restarts at 1 lot plus the top-up until the next window. Last, the trader types 35 lots by hand: CHRONOS sees a size it did not write and pauses its own size writes while the brake stays armed; “resume auto” makes it write its current 30 lots at once; and when the trader starts a switch from normal quoting to the smart-queue strategy, CHRONOS stops the first, confirms the position is flat, starts the other with the carried 30 lots and scores with that strategy’s model file. The strip below shows 20 ten-minute windows in three sittings, with the size of each and the hatched 4-lot floor.

How the model earned its place

Twenty models, months of unseen days, one shipped

Synthetic data. Illustrative values, generated to show the effect: the most accurate models and the simplest one tie on out-of-sample money, and the simplest ships. The contest design is as built: the 20 model variants and their input counts, the expanding-window walk-forward with a re-fit every five days, the look-ahead control and the tie rule. The scores, the day counts and the number of tied models are illustrative; the desk’s own figures are confidential. Money is an index, not an amount: each model’s out-of-sample gain from sizing quotes by its score, at equal traded volume, divided by the shipped model’s (= 100). One of the 20 is a deliberate look-ahead control, so 19 models competed.

Text description of this figure

Three panels; every score and day count is illustrative. The first lists the contestants: 3 weighted least-squares models, 4 ridge regressions, 11 gradient-boosted-tree variants from one LightGBM-style histogram booster written from scratch in pure Python (base setting 150 trees, depth 2, learning rate 0.10), and 2 ensembles, drawing on 53 candidate inputs audited for look-ahead. Below it a strip of 105 trading days shows the walk-forward test: 20 days to start, then 17 refits, each trained on every earlier day and scored on the next five, for 85 out-of-sample days. The second panel is a leaderboard with two bars per model: accuracy (out-of-sample correlation between prediction and realized profit per lot) and money (an index where the shipped model is 100). A control model that uses a look-ahead input has the highest correlation, 0.203, and is hatched and excluded. Sorted by accuracy, a pooled ensemble (0.179) and an ensemble (0.161) lead, more than double the 9-input weighted least-squares regression at 0.074, which ranks last of 19. Sorted by money, the order changes: the top five models score 103, 102, 102, 100 and 100, a statistical tie that includes the 9-input regression at 100, and the next model scores 87. A sentence under the table answers the obvious question: why not the most accurate? Accuracy counts every minute equally; money counts the minutes that carry the size. Five models tie on money, and the simplest of them ships. The third panel states the rule (no look-ahead, only what was known at the time; money decides, not accuracy; in a tie the simplest ships) and shows the result: the 9-input regression, BOOK_causal, shipped. It re-fits itself every trading day after the close.

What a bigger quote earns

The finding that changed how the desk sizes its quotes

Synthetic data. Illustrative data, generated to show the study’s shape: fills grow a little less than in proportion to size, and profit per lot stays flat. The method is as built: a log-log regression of fills on quote size with day and hour-of-day fixed effects, order-book controls and day-clustered standard errors, on the desk’s own fills with no simulator; profit per lot is the 5-second mark-out, shown as an index (average = 100), with whiskers of one standard error. Dashed lines are counterfactuals; the one in panel 2 is schematic. The window strip in panel 3 is an illustrative day at the same total volume. The bars for the desk’s change are schematic and not to scale: quote sizes are the desk’s settings and are not published, and no profit figure is claimed for the change. The desk’s own figures are confidential.

Text description of this figure

Three panels, read left to right; the data points are illustrative. The first plots fills against quote size on logarithmic axes, from 1 to 40 lots. Nine size-bucket averages lie on a straight line with slope 0.68, below a dashed one-to-one line that shows what proportional growth would look like: doubling the quote size brings less than double the fills, and the bucket of 32 to 40 lots gets about 11 times the fills of a 1-lot quote. The second panel plots profit per filled lot (the 5-second mark-out, as an index where the average is 100) against the same sizes. The nine bucket averages are 102, 90, 98, 97, 103, 99, 94, 97 and 98, all within about ten points of 100, with no significant slope; a dashed schematic line shows the decline one might have feared. The third panel shows the consequence. A strip of twelve 10-minute windows, each labeled with the model’s rank, moves from one size all day to large quotes in the five best-ranked windows and small quotes in the rest, at the same total volume; a hatched band marks the minimum size the market-making obligation keeps resting, which the trading engine tops quotes up to, so size never reaches zero. Below it, three schematic bars, without lots or dates, show the desk scaling its live-hog quote size several-fold on the finding: the range of sizes the study covered, then larger, then larger again. A dotted line marks the largest size in the study.

06All screens

The console, redrawn in English.

English redraws of the console on generated inputs; the desk’s own interface is in Chinese. Open any screen for its caption and numbered legend.9

07Under the hood

The model, the math, the validation and the engineering.

Under the hoodTarget, features, estimator, walk-forward validation, the 20-model table, the size law, the sizing rule and pseudo-code

CHRONOS is a supervised model inside a control loop. The model answers one narrow question, the value of a fill in the coming window, and everything around it is engineered to limit what a wrong answer can cost: the exchange obligation sets a floor, valves cap the size, a brake acts in seconds, and every write is verified.

In machine-learning terms: supervised regression on labeled trading minutes, nine leak-audited features, expanding-window walk-forward validation on months of unseen days, model selection by out-of-sample money across 19 causal candidates, automated daily retraining behind six acceptance gates, then live validation against hand sizing and recalibration on realized P&L.

All of the modeling is standard-library Python 3.10: nothing is installed on the trading machines, so least squares, ridge and the gradient-boosted trees are written from scratch, and the live chain, re-fit included, runs on the trading machine itself.

1. What is predicted

The target is the 5-second mark-out per filled lot: how far the mid price sits from the fill price five seconds after the fill, signed so that positive means the fill was a good one, and scaled to the contract. A minute’s label is the lots-weighted mean over its fills.

Why this target. It values a fill without a simulator: a snapshot-based simulator misses a size-dependent share of actual fills, so a simulated size sweep would measure its own artifact. And the 5-second mark-out tracks realized cash closely. Targets at longer horizons, from 30 seconds to 10 minutes, and a whole-window P&L target were tried later; none ranked windows better on realized P&L.

The decision interval is longer than the target horizon on purpose. A size change reaches only new orders, almost all of them within seconds; resting orders keep their size and queue position, so a setting needs minutes to be fully expressed. The 10-minute window was fixed in advance; 5 minutes backtested worse.

ym=∑i∈mvi·qsi(midti+5 s−pi)∑i∈mvi
For each fill i in minute m: v is lots, s is +1 for a buy and −1 for a sell, p is the fill price, mid is the mid price five seconds after the fill, and q is the contract multiplier (16 metric tons per lot for DCE live hog).

2. The nine inputs

All nine are known at the first tick of the minute, and live features are rounded exactly as the training panel printed them, so a live row reproduces its training row bit for bit (195 of 195 minutes in the self-test). Fifty-three candidate inputs were built and audited for look-ahead; the shipped model uses these nine.

On the full sample, time of day, five-level depth and trailing volume carry the signal: edge is higher later in the day, in deeper books and in busier markets. The in-sample fit is small: a single fill’s 5-second outcome is mostly noise, so the model is judged by the money its ranking moves (sections 4 and 5), not by its fit.

The nine inputs of the shipped model. Coefficient values are not published.
InputDefinition (at the minute’s first tick)
SpreadBest ask minus best bid
Log depthLog of total lots resting on bid levels 1–5 plus ask levels 1–5
Realized volatilityRoot of summed squared mid changes over the trailing 30 s
Absolute imbalanceBest-level imbalance, |bid − ask| ÷ (bid + ask) in lots
Log volumeLog of market volume over the trailing 30 s
Absolute inventoryInventory in units of the quote size
Absolute price moveMid-price move over the trailing 30 s
Time of dayIn hours
Log quote sizeHeld constant live, since the size in force carries no timing information

3. Estimator

Weighted least squares with squared-error loss; the weight of a minute is the number of lots filled in it, so minutes that carry more money count more. No regularization, no standardization, no hyperparameters. The normal equations are solved by Gauss–Jordan elimination with partial pivoting, which also returns the inverse used for the standard errors.

The research reported day-clustered standard errors. The live re-fit computes heteroskedasticity-robust (HC0) standard errors, which its acceptance gates use (section 8).

β^=argminβ∑mwm(ym−xm⊤β)2=(X⊤WX)−1X⊤Wy,wm=lots filled in the minute
Lots-weighted least squares over labeled minutes m; x holds the nine inputs and an intercept.
Pseudo-code
def weighted_least_squares(rows, targets, weights):
    A, b = zeros(k, k), zeros(k)
    for x, y, w in zip(rows, targets, weights):      # one pass builds the normal equations
        A += w * outer(x, x)
        b += w * x * y
    beta, A_inv = gauss_jordan(A, b)                  # partial pivoting; also returns the inverse
    meat = zeros(k, k)
    for x, y, w in zip(rows, targets, weights):
        u = w * (y - dot(x, beta))                    # weighted residual
        meat += u * u * outer(x, x)
    cov = A_inv @ meat @ A_inv                        # HC0 sandwich
    return beta, sqrt(diag(cov))
Pseudo-code. The estimator, simplified: the normal equations accumulated in one pass and solved by Gauss–Jordan elimination, then the HC0 sandwich for the standard errors. The daily re-fit uses the same method.

4. Validation: walk-forward, then a leakage audit

Design. Expanding-window walk-forward: a burn-in, then a re-fit every 5 test days on all strictly earlier days, over months of out-of-sample days. A prediction never sees its own day. All hyperparameters of every model were fixed before the test.

Leakage audit. Shuo’s rule from the first day was that history must be consumed as a live stream. Auditing against it removed a feature that used the current minute’s own traded volume, which more than halved the measured out-of-sample correlation. He accepted the smaller, honest number. A within-window averaging look-ahead and six smaller items in the candidate models were fixed in the same audit.

Data integrity. Reconciling against settlement data exposed a logging quirk that mislabeled some fills, and therefore some training labels. Shuo fixed the extractor, re-fitted, and made reconciliation a standing check.

The ceiling. Split-half reliability bounds the best possible correlation for any predictor of this target; the shipped model reaches a small fraction of that ceiling and the best causal model not much more. The limit is information at the start of the minute, not model form.

Results in words: the study’s figures are confidential. Backtests are measured by 5-second mark-out at equal daily volume, not live profit.
QuantityResult
Labeled sampleOne row per trading minute, from several months of the desk’s own fills across three successive contracts; it grows with every daily re-fit
Walk-forwardA burn-in, then a re-fit every 5 test days on all strictly earlier days
Out-of-sample correlationLow but stable, as expected for a noisy 5-second target
Daily Spearman rank ICPositive on nearly every test day
Reliability ceiling of the targetSplit-half; the shipped model reaches a small fraction of it
Backtest against hand sizingAhead out of sample at equal traded volume4
Live parity with the research pipeline195 of 195 minutes bit-identical in the self-test

5. The tournament: accuracy doubled, money did not

Twenty model tags ran the same out-of-sample days: weighted least squares, ridge regressions, 11 gradient-boosted-tree variants, models pooled across two contracts, and ensembles of within-day z-scores. One tag is a deliberate look-ahead control, so 19 competed.

The booster is Shuo’s own: a lots-weighted, LightGBM-style histogram gradient booster, written from scratch in pure Python (150 trees, depth 2, learning rate 0.10, 16 weighted-quantile bins, a minimum leaf weight; squared-error loss; fully deterministic).

Ensembles and pooled trees lifted the out-of-sample correlation far above the regression’s. Ranked by out-of-sample money, the lead vanished: the top models finished in a statistical tie that included the 9-input regression, and the simplest model in the tie shipped. It can also be re-fitted exactly, every day, on a machine with no libraries. The chart and table below replay the contest on synthetic scores: there, five models tie between 100 and 103 on an index where the shipped model is 100.

Also tested and rejected: session dummies, recency-weighted training, and shrinking size in thin books. The engine’s own tick-level price signal belongs to the desk’s model team; CHRONOS uses its own order-book features.

Accuracy against money, 19 models

More than double the accuracy bought no money: the most accurate models finished in the same statistical tie as the simple model that shipped.

Data: Accuracy against money, 19 models
SeriesOut-of-sample correlationMoney index (shipped model = 100)Label
Boosted trees0.154102
Boosted trees0.152102
Boosted trees0.12887
Boosted trees0.12083
Boosted trees0.10477
Boosted trees0.13076
Boosted trees0.12969
Boosted trees0.10468
Boosted trees0.11168
Boosted trees0.12966
Boosted trees0.11163
Linear and ensembles0.179103
Linear and ensembles0.161100
Linear and ensembles0.08887
Linear and ensembles0.08175
Linear and ensembles0.08164
Linear and ensembles0.08664
Linear and ensembles0.10263
Shipped: 9-input WLS0.074100Shipped
Synthetic data. Illustrative values, generated to show the effect; the contest design is as built. The 19 competing models on the same out-of-sample days (walk-forward, 10-minute windows, equal traded volume). Accuracy is the out-of-sample correlation of the table below; the most accurate model, a pooled ensemble, reaches 0.179, against 0.074 for the model that shipped. Money is an index: each model’s out-of-sample gain from sizing by its score, divided by the shipped model’s. The shaded strip is the five-way tie, 100 to 103. The look-ahead control is left out.
Pseudo-code
def best_split(node_rows, features, residual, weight):
    total_r, total_w = sum(weight * residual), sum(weight)
    base = total_r ** 2 / total_w
    best = None
    for f in features:
        hist_r, hist_w = weighted_histograms(f, node_rows)    # one pass per feature
        left_r = left_w = 0
        for split in bins[:-1]:                               # scan the split points
            left_r += hist_r[split]
            left_w += hist_w[split]
            right_r, right_w = total_r - left_r, total_w - left_w
            if min(left_w, right_w) < min_leaf_weight:
                continue
            gain = left_r ** 2 / left_w + right_r ** 2 / right_w - base
            best = better_of(best, (gain, f, split))
    return best
Pseudo-code. The split search of the histogram booster, simplified: one pass per feature fills lots-weighted histograms, then a scan over bins finds the split with the largest weighted squared-error reduction.
Synthetic data. Illustrative scores, generated to show the effect; the models, families, input counts and variants are the contest’s own. Same out-of-sample days, same walk-forward, 10-minute windows, equal traded volume. Money index: each model’s out-of-sample gain from sizing by its score, divided by the shipped model’s (= 100). The desk’s own figures are confidential.
ModelFamilyInputsVariantOOS corr.Money index
ENS_poolEnsemble3 modelspooled models.179103
GBM2_poolBoosted trees53trained on both contracts.154102
GBM2_mo30_poolBoosted trees5330-second target, pooled.152102
BOOK_causal (shipped)Weighted least squares95-second mark-out per lot.074100
ENSEnsemble7 modelsmean of within-day z-scores.161100
BOOK_causal_poolWeighted least squares9trained on both contracts.08887
GBM2_dmBoosted trees53day-demeaned target.12887
GBM2_mo30Boosted trees5330-second target.12083
GBM2_dmsBoosted trees53day-and-session-demeaned target.10477
GBM3Boosted trees53120 trees, depth 3.13076
RIDGE_dmRidge53day-demeaned target.08175
GBM2_slowBoosted trees53300 trees, learning rate 0.05.12969
GBM2Boosted trees53base booster.10468
GBM2_dm_recBoosted trees53day-demeaned target, recency-weighted.11168
GBM2_fwd3Boosted trees533-minute-ahead smoothed target.12966
SEASON_LAGSRidge15seasonal encoding and lagged edge.08164
RIDGE_ALLRidge53all candidate inputs.08664
RIDGE_ALL_poolRidge53trained on both contracts.10263
GBM2_recBoosted trees53recency-weighted training.11163
BOOK_asis (control)Weighted least squares9uses the minute’s own volume: look-ahead, excluded.203excluded

6. The size law

Before any model, the study measured what size does, on the desk’s own fills at the sizes traders had actually set. Fill volume scales with size at an elasticity a little below 1, tightly estimated. Profit per lot shows no decline with size: the slope of the 5-second mark-out on log size is statistically zero.

Together these make the equal-volume optimum bang-bang: with per-lot edge flat in size, the best use of a fixed daily volume is the maximum size in the best-ranked windows and the minimum elsewhere. The comparison holds daily volume fixed because the exchange’s market-maker terms depend on it, so equal volume isolates timing. The study also named the larger lever: scaling size under a hard inventory cap was worth far more than timing. That is the finding the desk acted on.3

Checked again at decision time. The obvious objection is adverse selection: a bigger quote is hit hardest when the market runs through it. Measured at fill time that is true, and it is the sweep itself (a book is thin because it was just eaten), so it predicts nothing. Measured at the start of the window, on ten-minute windows over several months, per-lot value is flat in size, in order-book depth and in size relative to depth, and sizing in proportion to depth did worse than the shipped rule at every scale tried. The tail belongs to the quoted-levels rule and the brake (sections 7 and 8).

The inventory cap. A hard cap on inventory costs little profit for much less tail exposure, and is far more efficient than a soft inventory penalty. The size rule is built on it.

lnVm=α+ηlnsm+γ⊤zm+εm,0<η^<1
V is lots filled in minute m, s the quote size in force, z day, time-of-day and order-book controls; standard errors clustered by day. The estimate sits a little below 1.
Synthetic data. Illustrative values of the elasticity η, generated to show the pattern. A new size is fully expressed only after the resting book turns over: the elasticity is highest once a setting has stood for half an hour, which is why decisions are made every 10 minutes rather than every minute.
Time the setting has been in forceElasticity
Under 2 minutes0.62
2 to 10 minutes0.65
10 to 30 minutes0.67
30 minutes or more0.75
All minutes0.68

7. From score to size

The window’s score is the model’s prediction at the window’s first minute. Thresholds are recomputed every day from a trailing window of the same strategy’s trading days.

  • Level L. The base size from the risk menu: with per-lot edge flat in size, the objective puts the optimum at the largest size the inventory cap allows.
  • Band multiplier M. Top band: the high multiplier, solved for volume neutrality, so these windows quote the full base size. The middle and bottom bands quote fixed fractions of it.
  • Valves, in order. A liquidity cap proportional to recent best-level depth; a thin best level among other traders forces the minimum size; inventory beyond the risk cap forces the minimum; the exchange position limit forces the minimum; the loss brake forces the brake size until the next window.
  • Quoted levels. CHRONOS quotes fewer price levels at larger sizes.

Why bands and not a continuous size. With per-lot edge flat in size, the equal-volume optimum is bang-bang: rank the windows and give the best ones the maximum. The live rule fixes the share of top windows and recalibrates the thresholds every day from the trailing window.

Why the low band is not the minimum. On the mark-out yardstick the optimum is the minimum size against the maximum. Re-scored on realized P&L (section 9), a larger low band earned more money; the minimum is kept for the valves.

Why never 0. A designated market maker must keep a minimum size resting on both sides, within a maximum spread, for a minimum share of each month’s trading time, and the engine tops resting quotes up to that minimum.2 Stopping earns no qualifying quote time, and it does not pay: losing windows are rare and short-lived, so a pause rule has little to recover, even on the windows the model ranks worst. So the forecast sets size, and stopping is left to the brake.

rec=clamp(min(L·M(band),cliq),smin,smax)
L is the base level, M the band multiplier, c the liquidity cap from recent best-level depth, and smin and smax the configured size bounds; the safety valves then apply in order.
Pseudo-code
def recommend(score, base_size, book, position):
    band = "top" if score >= top_line else "bottom" if score < low_line else "middle"
    size = base_size * multiplier[band]
    size = min(size, liquidity_cap(book))          # from recent best-level depth
    size = clamp(round(size), min_size, max_size)
    if thin_book(book):                 size = min_size
    if abs(position) > inventory_line:  size = min_size
    if abs(position) >= exchange_limit: size = min_size
    if brake_active:                    size = brake_size
    return band, size
Pseudo-code. The size rule, simplified: the band lookup, the liquidity cap, then the valves in their fixed order. Lines and multipliers are settings and are not shown.

8. The loss brake, guarded writes and the daily re-fit

Brake. Evaluated on every P&L print of the engine, about once a second, over a short and a longer window. The default action is a cycle: write cancel-only plus the brake size, wait for the engine’s acknowledgment, then run again. A position buffer, a colleague’s suggestion, holds the brake back while the position is large relative to the quote size. Replayed on months of rebuilt per-second P&L, it fired rarely, and correctly.

Write gate. File parses → not replaying → contract armed → not halted → loop on → no manual hold → inside the rate limit. Brake and human actions bypass only the last two. Every outcome is journaled, and a write stays pending until the engine’s own log prints the new values.

Writer. Never parse-and-serialize: only the value bytes between an element’s opening and closing tags change, so byte-order mark, line endings, comments and indentation survive. Read → edit → re-check modification time and size (another writer may have got in) → temp file in the same folder → atomic replace with retries → read back → byte-compare. The original is backed up before every write. Starting a strategy is reserved for confirmed human actions and brake restarts. The write is sketched in section 11.

Daily re-fit. After the close the machine parses the day’s log (snapshots, fills, the size in force, status lines), tags every minute with the strategy that was running, and re-fits each strategy’s model on its own minutes; a new strategy borrows the main model’s coefficients until it has enough days and minutes of its own. The on-machine chain reproduces the research pipeline’s coefficients and standard errors exactly and its thresholds to 1e-9. CHRONOS also mirrors the log as it reads, so the re-fit never depends on the day’s files staying in place. Production evidence: the model file later exported from the trading machine carried the previous trading day’s post-close stamp, written by the automatic update.

brake⇔(P(t)−P(t−τ1)≤−θ1)∨(P(t)−P(t−τ2)≤−θ2)
P is the engine’s own running P&L for the contract; τ1 is the short window and τ2 the longer one. The windows and the two thresholds are desk settings and are not published. A mode switch can require both conditions instead of either.
Pseudo-code
def change_over(window):                  # P&L now minus the latest sample at or before now - window
    past = latest_sample_at_or_before(now - window)
    return None if past is None else pnl_now - past

def brake_tripped():
    short, long = change_over(short_window), change_over(long_window)
    hit_short = short is not None and short <= -loss_short
    hit_long = long is not None and long <= -loss_long
    return (hit_short and hit_long) if require_both else (hit_short or hit_long)
Pseudo-code. The brake’s trigger, simplified: the windowed P&L change and the two-layer test. A window that the P&L series does not yet cover never trips.
A failed gate keeps the previous file and names the gate on screen. Every accepted file gets a dated backup and is hot-reloaded.
Acceptance gate before a new model file is writtenRule
Coefficient stabilityEvery coefficient within 4 of its own standard errors of the previous file
Fit qualityIn-sample correlation at least 60% of the previous model’s
Band shareTop-band share inside a fixed sanity range
Solver sanityHigh multiplier strictly inside its solver bounds
Sample sizeA minimum number of rows, days and calibration days
Complete dayA minimum tick count and a last tick near the close

9. Live validation and re-scoring on realized P&L

The live test was a colleague’s criterion: within a day, do the periods quoted at larger size earn more per lot? Shuo rebuilt every constant-size period from the raw engine log, reconciled every live day to the desk’s settlement records exactly, and compared with hand sizing before launch.6

Edge and carry. Total P&L splits exactly into fill edge (fill price against the next mid) and inventory carry (position times each tick’s mid change); the identity is checked to zero every day. The model predicts edge, as designed. Carry is not predictable at the start of a window: a carry-only model’s walk-forward rank correlation is close to zero.

Re-scoring. Every window of months of reconciled days was then re-scored on realized P&L, edge plus carry, walk-forward. The model and its nine inputs stood; the rule moved money. A wider top band and a larger low band beat the deployed rule on total P&L, per-lot P&L and equal-volume gain, in both halves of the sample and on the live days, and shipped as v1.7.1.

What Shuo did not ship. Sixty-seven recency and contract-aging weighting schemes were tested walk-forward; none beat uniform weights significantly, and picking a scheme by recent performance lost money in the backtest. The two closest contenders run as shadow arms: scored on every window, logged, never written to the engine.

Results in words: the desk’s figures are confidential. Realized P&L = fill edge plus inventory carry. Gains are measured at equal daily volume against one constant size. These measure the sizing signal, not the desk’s total profit.
EvidenceResult
Live: daily correlation of size with profit per lotPositive on every live day checked; weak and mixed under hand sizing6
Live: largest-third minus smallest-third sizes, profit per lotPositive on every live day checked
Live: where the edge came fromThe larger quotes carried most of it; the periods include sizes traders set by hand
Walk-forward on realized P&L: deployed two-band ruleSignificantly ahead of one constant size
Walk-forward on realized P&L: shipped three-band ruleFurther ahead; better in both halves of the sample and live
Top-band against other windows, realized profit per lotClearly higher, on most days
67 recency-weighting designs against uniformNone significantly better

10. Failure modes engineered out

Each row is something that can go wrong on a live desk, and the mechanism that prevents it.

Failure modeWhat prevents it
A feature that peeks at the futureStream-order rule and a leakage audit of all 53 candidates; the self-test proves live features equal the research panel bit for bit
A logging quirk mislabels some fillsFill direction read from the engine’s own fill lines; daily reconciliation to settlement as a standing check
A price burst sweeps the resting quotes within secondsA seconds-scale two-layer brake replaced a periodic guard; fewer price levels are quoted at larger sizes
A trader’s hand-set size is overwrittenAny size CHRONOS did not write is treated as a takeover and pauses its writes; “resume auto” writes the model’s size back at once
Another writer changes the file mid-writeConditional write: modification time and size re-checked, atomic replace, byte-verified read-back, backup of the original
The day’s logs are gone before the re-fitRe-fit right after the close, with a mirrored copy of the log as fallback
A bad model re-fitSix acceptance gates, dated backups, and the previous file kept on any failure
A bad software updatePinned-signature and version checks before install; health window; automatic revert in 8 seconds; the bad version blocklisted
A secret leaks into a diagnostic bundleConfig redaction plus a final scan of every bundle member that aborts the build

11. Engineering and tests

  • One signed executable. A C# self-extracting supervisor carries the whole program and a slim Python runtime. Updates are checked through Windows’ own trust API (WinVerifyTrust through ctypes) plus the signer’s pinned thumbprint, staged, and applied on restart.
  • 43 automated self-tests run on the trading machine itself, including reproduction of the research coefficients to the last digit, file writes through the guarded writer, and every page setting sent the way the page sends it. A 42-check end-to-end run proves the update path: check, stage, apply, crash, automatic revert, blocklist.8
  • Feed verification. 16,575 of 16,575 snapshots identical to the exchange multicast; the log trails the engine with sub-second lag.1
  • Research records. A row per contract-minute of what was displayed, every write and every parameter change, bundled daily with a checksum manifest for the daily validation report.
  • Interface and storage. A single-page HTML and JavaScript console served by Python’s own http.server, with a read-only reader for trader PCs; a pure-Python MySQL client writes recommendations, minutes and actions to the desk’s MariaDB.
  • Constraints. Locked-down trading machines with nothing installed. Everything is one double-click.
Pseudo-code
for attempt in range(3):
    original, stamp = read_file_and_stat(path)
    updated = replace_value_bytes(original, contract, new_values)    # nothing else in the file changes
    if stat(path) != stamp:               # another writer got in: read again
        continue
    backup(original)
    temp = write_and_fsync(temp_file_in_same_folder, updated)
    atomic_replace(temp, path)            # retried while the engine holds the file open
    if read_file(path) != updated:        # byte-for-byte read-back
        raise WriteError("verification failed: check the file by hand")
    break
else:
    raise WriteError("the file kept changing: another program is writing it")
Pseudo-code. The conditional, atomic, verified write that is CHRONOS’s only path into the live engine, simplified. Only the value bytes change; if another writer touched the file since it was read, the loop re-reads; the new bytes go to a temp file flushed to disk and swapped in atomically, then are read back and compared byte for byte.

Built with

  • Machine learning
  • Supervised regression
  • Feature engineering
  • Weighted least squares (HC0 robust errors)
  • Histogram gradient-boosted trees, written from scratch
  • Ridge regression and ensembles
  • Walk-forward validation
  • Backtesting
  • Model selection on out-of-sample P&L
  • Leakage auditing
  • Automated daily retraining with acceptance gates
  • Shadow deployment
  • Market microstructure
  • Order-book modeling
  • Closed-loop control
  • Real-time log processing
  • Data pipelines
  • Python 3.10, standard library only
  • HTML / JavaScript console
  • C# launcher
  • PowerShell build and publish
  • MariaDB / SQL
  • Authenticode-signed self-updating executable
  • Windows internals: ctypes, WinVerifyTrust
  • Atomic, byte-verified file writes
  • Automated self-tests

08Releases

Research to closed loop in three weeks; 46 versions in 23 days.

  1. Research beginsOn his own initiative: what does quote size do, measured on the desk’s own fills with no simulator.
  2. v0.1 · first consoleModel tournament, leakage audit and model specification done; console built from the study.
  3. v0.3 · recommend-onlyAn absolute recommendation that needs no trader input; Shuo traded by its numbers.
  4. v0.9 · the engine log becomes the feed16,575 of 16,575 snapshots identical to the exchange multicast; one-button start.
  5. v1.0 · closed-loop writerGuarded configuration writer, two-layer seconds-scale loss brake, per-contract control, manual takeover, emergency stop.
  6. v1.3 – v1.5 · renamed CHRONOS; the model re-fits itselfv1.3 takes the name CHRONOS; v1.4 adds the per-contract strategy switch; v1.5 a daily on-machine re-fit with one model per quoting strategy.
  7. v1.7.1 · sizing rule recalibratedEvery window re-scored on realized P&L, walk-forward; a better sizing rule ships the same night.
  8. v1.7.3 · shadow armsTwo alternative calibrations scored on every window and logged, never written.
  9. v2.0 · one signed executablePassword-gated self-update that verifies the signature and reverts automatically on failure.
  10. v2.1.4 · brake refinementsThe brake holds in cancel-only; position buffer.
  11. v2.1.7Settings hardening. 43 self-tests and a 42-check end-to-end run. The 46th version.
  1. 1Measured by Shuo on the trading machine: the log trails the engine with sub-second lag, and 16,575 of 16,575 order-book snapshots in the log were identical to the exchange’s multicast feed.
  2. 2Exchanges designate market makers with quoting duties; in general terms, a minimum size on both sides, within a maximum spread, for a minimum share of each month’s trading time. The engine tops resting quotes up to the minimum automatically; the top-up is the engine’s own feature, built by desk IT.
  3. 3Measured on the desk’s own fill records from several months of trading, with no simulator: fill volume grows a little less than in proportion to quote size, and profit per lot, the 5-second mark-out, shows no decline with size. Quote sizes are the desk’s settings and are not published; no profit figure is claimed for the change.
  4. 4Twenty model tags; 19 competed and one is a deliberate look-ahead control. On out-of-sample money the top models finished in a statistical tie, and the simplest of them shipped. The backtest is walk-forward, measured by 5-second mark-out at equal traded volume, and is not live profit. The scores in the tournament figure, chart and table are synthetic.
  5. 546 numbered versions, v0.1 on Sep 2, 2026 to v2.1.7 on Sep 24, 2026, counted from the project’s release headers.
  6. 6Per day: the volume-weighted correlation between quote size and profit per lot across constant-size periods, rebuilt from engine logs and reconciled to settlement records, from the day recommendations began to vary. A correlation, not an experiment: the periods include sizes traders set by hand, and it measures how size and per-lot profit moved together, not total profit.
  7. 7As of November 2026. Where the desk quotes at larger, hand-managed sizes, traders set the size themselves.
  8. 8Final release v2.1.7: 43 automated self-tests, and a 42-check end-to-end run of the signed update path (check, stage, apply, crash, automatic revert, blocklist).
  9. 9Charts, figure data and screenshots on this page are synthetic, illustrative or public market data. Methods and outcomes are described as they happened; the desk’s own figures are confidential and do not appear here. The screens are English redraws of the console, rendered from a generated order book on the contract’s tick grid at a fictitious price level and an illustrative configuration.
Previous
Previous

Strategy Console

Next
Next

Strategy One