Professional · Trader, Market Making Department · Nanhua Futures
I make markets. I built the models and machines that changed how my desk trades.
I joined Nanhua Futures in Hangzhou as a Trader in July 2026 and was confirmed to full‑time two months later, a first at the firm.1 I make markets in six Dalian Commodity Exchange futures, including the desk’s most profitable product. I conceived, designed and built all 25 trading systems, desk tools and quant studies listed here for the desk, from scratch and on my own initiative:2 a self-retraining machine-learning model that sizes live quotes, a platform that controls the strategies on every trading machine from one screen, and research that changed the desk’s quote sizes, its server and its live spread settings. Charts, 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.
Enlarge
- Marker 1: Machine cards (top left): one card per trading machine, with its link status, memory and a stop for that machine alone.
- Marker 2: Status switches: run, pause, stop or cancel-only for each strategy, sent to the machine and confirmed in one to three seconds.
- Marker 3: Order size: step it or type it; the change is written into the engine’s live configuration and read back.
- Marker 4: Streamed numbers (Trends, top right): profit per lot, profit and loss and lots traded stream in from each engine’s own log; this redraw shows the controls only.
- Marker 5: Stop All (top right): one confirmed click stops every strategy on every machine.
01The desk
Six futures, quoted on both sides, the desk’s most profitable among them.
A market maker stands in the market all session offering to buy and to sell, and is paid for it by the exchange only while it meets strict quoting and open-interest obligations. I run that for six Dalian Commodity Exchange products.
2months
to full-time confirmation, a first at the firm1
6
Dalian Commodity Exchange futures I make markets in3
25
trading systems, desk tools and quant studies, all conceived, designed and built from scratch, on my own initiative2
46
numbered CHRONOS versions shipped in 23 days4
20
models in the walk-forward tournament that chose the CHRONOS model, including one look-ahead control5
2,410/ 2,410
contract-days on which my effective-open-interest calculation matched the exchanges’ own obligation reports6
- jdEgg
- jmCoking coal
- lLLDPE
- lhLive hog
- pPalm oil
- ySoybean oil
02What I do
Quant analysis. Automation design. Strategy optimization.
Three things, each carried from a question on the desk to software running on it, in Python, SQL and PowerShell.
Quant analysis
I measure what each fill really earned: the mid price seconds later against the fill price, on the desk’s own fill records, reconciled to settlement. I rebuild other people’s simulators until they match fill for fill, and only then argue with them. Fifteen desk investigations run the same way, most of them rebuilt tick by tick from raw engine logs.
Automation design
I close the loop. A model reads the trading engine’s log, decides, writes its decision into the engine’s live configuration and reads it back byte for byte, with a seconds-scale loss brake and a trader override on top.
Strategy optimization
I choose by search and then distrust the winner: an exhaustive sweep of every tradable spread and parameter cell, with every winning row re-run by an independent driver and checked for stability across blocks of days, and a walk-forward tournament of about 20 models scored on months of trading days they had never seen; the top models tied on out-of-sample money, so the simplest of them shipped.
Machine learning and statistics
Models that survive unseen days
- Machine learning
- Walk-forward validation
- Out-of-sample model evaluation
- Gradient-boosted trees
- Weighted least squares
- Fixed effects, clustered errors
- Ridge regression
- Model ensembles
- Leakage audits
- Shadow A/B arms
- Difference-in-differences
- Order-book feature engineering
- Monte Carlo simulation
Quantitative trading research
What the order book says
- Market microstructure
- Order-book modeling
- Mark-out attribution
- Backtesting
- Simulator replication
- Queue and fill models
- Price-impact modeling
- Tick-level trade forensics
- Latency analysis on nanosecond logs
- Signal-decay (IC) analysis
Optimization
Finding the best configuration
- Exhaustive grid search
- Successive halving
- Two-objective Pareto selection
- Hold-out validation
- Constrained search
- Parallel tick replay
Automation and real-time systems
Software that acts on a live desk
- Real-time systems
- Closed-loop control
- Automation
- Loss brakes and risk guards
- Atomic byte-verified writes
- Daily self-retraining
- Production deployment
- Scheduled reporting pipelines
- Requirements specifications
Engineering
Built for locked-down trading machines
- Python
- Pure-Python numerics (no NumPy)
- SQL / MariaDB
- PowerShell
- C# signed launchers
- C++ code review and patches
- JavaScript
- R
- Windows internals
- Signed self-updating executables
- Data pipelines
- One-click SQL extracts
- Nanosecond engine-log parsing
- Authenticode code signing
- Windows UI automation
- Automated testing
03CHRONOS · self-retraining machine-learning controller for live hog
Every ten minutes, a machine-learning model I built decides how much the desk quotes in live hog.
I conceived, designed and built CHRONOS from scratch, alone and on my own initiative. It reads the five-level order book, predicts what each traded lot will earn, and sets the order size inside the desk’s high-frequency trading engine by itself.
The problem. A market maker’s most important dial is how much to offer at a time. Offer too little and the good moments pass; offer too much at the wrong moment and you are left holding inventory as the price runs away. On the desk that dial was turned by hand, many times a day. I asked whether the data could turn it better, and nobody had asked me to.
What I built. Every 10 minutes CHRONOS reads the order book and recent trade flow from the engine’s own log, forecasts what a filled lot will be worth seconds after it trades, and ranks the coming window against recent history. A strong window gets a large size, a weak one a small size. It then writes its decision straight into the engine’s live configuration, and reads every write back. A brake that reacts within seconds cancels the quotes when losses build, cuts the size and restarts the strategy on its own. The model re-fits itself after every trading day.
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 I wrote from scratch), ridge and ensembles. The top models tied on out-of-sample money, so the simplest of them shipped.5
The pace. Research began on August 25, 2026. Nine days later it was live, with me trading by its numbers. Twelve days after that it controlled the engine directly. It went through 46 versions in 23 days.4
What changed. Its central finding changed how the desk sizes its live-hog quotes (the next case), and CHRONOS still runs on contracts quoted at steady size through the day.7
Think of a stall-holder who decides every ten minutes how much stock to put on the counter. CHRONOS watches how busy the street is, puts more out when each sale is likely to be a good one, less when it is not, and pulls the shutter down in seconds if the till starts to bleed.
From order book to order size, with the brakes
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 was chosen: money decides, not accuracy
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.
Three parts, each with one job
Model
Scores the window
A machine-learning model predicts profit per filled lot from the five-level order book and recent flow. It was chosen in a walk-forward contest on months of unseen trading days, where it tied for the top and was the simplest, and it re-fits itself after every trading day.
Controller
Sets the size
Three bands map the score to an order size and a number of quoted levels. Liquidity, inventory and exchange limits can only reduce it. Every write to the engine is atomic and read back byte for byte.
Brake and override
Keeps it safe
A two-layer loss brake acts in seconds: cancel, shrink, restart. The exchange obligation holds at any size. A trader can take over at once, and an emergency stop silences every write.
Why the 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.8 Pulling out in a poor window forfeits quoting time that a later, larger quote cannot buy back.
So CHRONOS never asks whether to quote. It decides how much. When a window looks poor it shrinks the order, and the engine itself tops resting quotes up to the minimum. The screen shows one decision in each band, with the arithmetic behind it.
Enlarge
- Marker 1: Band: where the model ranks the coming 10-minute window against recent history.
- Marker 2: Recommended size (large figure): the order size for the coming window, in lots.
- Marker 3: Band multiplier: the base size times the band’s multiple gives the size.
- Marker 4: Liquidity cap: from recent depth at the best prices; it can only reduce the size.
- Marker 5: Position against the inventory cap; over the cap, the size is forced down.
- Marker 6: Price levels quoted: fewer levels at larger sizes.
Under the hoodTarget, features, estimator, tournament, sizing rule, self-retraining and code
CHRONOS is a supervised model with a controller around it. The forecast sets size and quoting depth; stopping and restarting come from the loss brake and from a trader-started strategy switch that CHRONOS executes. Stopping on the forecast alone was tested and rejected. The engine’s own tick-level price signal belongs to the desk’s model team; CHRONOS uses its own order-book features.
Target, features and estimator
The label is the 5-second mark-out of each fill, in currency per lot: the mid price five seconds after the fill against the fill price, signed by side and scaled by the contract multiplier (16 metric tons per lot). Fills are aggregated to the minute as a lots-weighted mean , and the minute’s lots are the regression weights , so a minute with more trading is both more reliable and worth more.
- Nine features, all known at the minute’s first tick: bid-ask spread, log five-level depth, 30-second realized volatility, absolute level-1 imbalance, log trailing 30-second market volume, absolute position in units of order size, absolute 30-second mid move, time of day, and log order size (held constant live, because size carries no timing information).
- Estimator: weighted least squares, squared-error loss, no regularization; normal equations solved by Gaussian elimination in standard-library Python, because nothing is installed on the trading machines. The live refit uses heteroskedasticity-robust (HC0) standard errors for its acceptance gate.
- Data: one row per trading minute from several months of the desk’s own fills across three successive contracts, growing with every daily re-fit.
- What carries the signal: depth, trailing volume and time of day. Edge is higher in deeper books, busier markets and later hours.
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))Validation and the tournament
Expanding-window walk-forward: a burn-in, then a re-fit every 5 test days on strictly earlier days, over months of out-of-sample trading days. A prediction never sees its own day. Hyperparameters of every contestant were fixed in advance.
A leakage audit of 53 candidate features removed a same-minute volume input as look-ahead. Removing that input alone more than halved the measured out-of-sample correlation, and I accepted the smaller, honest number; a within-window averaging look-ahead and six smaller items were fixed in the same audit. Split-half reliability bounds the best possible correlation for this target; the shipped model reaches a small fraction of it. The limit is information, not modeling.
The contestants: weighted least squares, ridge regressions, 11 gradient-boosted-tree variants from a lots-weighted histogram booster I wrote in pure Python (150 trees, depth 2, learning rate 0.10, 16 bins, a minimum leaf weight in lots; deterministic, bit-for-bit reproducible), models pooled across contracts and ensembles of within-day z-scores. Pooled trees doubled the correlation. Sizing by their score did not make more money. In a tie the simplest model ships.
| Measure | Result |
|---|---|
| Out-of-sample correlation, shipped model | Low but stable, as expected for a noisy 5-second target |
| Out-of-sample correlation, pooled boosted trees | About double the shipped model’s |
| Daily Spearman rank IC, shipped model | Positive on nearly every test day |
| Money index of the top models (shipped = 100) | A statistical tie |
| Backtest against hand sizing, equal volume | Ahead out of sample at equal traded volume9 |
| Reliability ceiling of the target | Split-half; the shipped model reaches a small fraction of it |
From score to action
The window’s score is the prediction at its first minute. Thresholds recomputed daily from a trailing window of the same strategy’s trading days place it in one of three bands; the band sets a multiple of the base level , solved so that total volume is unchanged. Then the valves act in a fixed order, and each can only reduce the size: a liquidity cap from recent depth at the touch, a thin-book line, an inventory threshold, the exchange position limit, and the loss brake.
- Why volume is held fixed. The exchange’s market-maker terms depend on it, so every comparison moves size from the windows the model scores lowest to the windows it scores highest, never to zero.
- Loss brake. Two layers on a short and a longer profit-and-loss window, evaluated on every engine print. It puts the strategy in cancel-only at a reduced size, waits for the engine’s acknowledgment and restarts. Replayed on months of rebuilt per-second data, it fired rarely, and correctly.
- Writer. Changes only the value bytes it owns; conditional on the file’s modification time and size, atomic replace, byte-verified read-back, backup of the original, rate-limited; a write stays pending until the engine’s own log shows the new values.
- Trader override. A size CHRONOS did not write pauses its size writes while the brake stays armed; “resume auto” writes the current recommendation at once.
Self-retraining and live evidence
After every trading day’s close CHRONOS rebuilds its model on the trading machine from that day’s engine logs, one model per quoting strategy; a full day refits in about 4 seconds. A refit is written only if it passes gates: every coefficient within 4 standard errors of the previous file, in-sample correlation at least 60% of the previous model’s, band shares and multiples inside bounds, and a complete log. It keeps dated backups and hot-reloads. The on-machine fitting chain reproduces the research pipeline to 1e-9, and the whole system ships as one signed, self-updating executable for locked-down Windows machines.
On a test a colleague proposed, every constant-size period is rebuilt from raw engine logs and reconciled to the desk’s settlement records. Live, once its recommendations began to vary, larger sizes went with higher profit per lot on every live day checked.10 Re-scoring on realized P&L changed the sizing rule, not the model.
| Engineered out | How |
|---|---|
| Look-ahead in features | Audit of 53 candidates; the same-minute volume input removed at the cost of more than half the measured correlation; eight items fixed in all |
| Mislabeled fills | Reconciling to settlement exposed a logging quirk that mislabeled some fills; I fixed the extractor and made reconciliation a standing check |
| A bad daily refit | Acceptance gates, dated backups, hot reload |
| A torn configuration file | Atomic replace with byte-verified read-back |
| Fighting the trader | Manual takeover pauses size writes; the brake still acts |
| Research and live drifting apart | Live features equal the study panel on 195 of 195 minutes; 43 automated self-tests and a 42-check end-to-end run |
04Quant research · the finding behind CHRONOS
My research showed profit per lot holds up as size grows. The desk scaled its live-hog quoting size several-fold on it.
Measured on the desk’s own fills, with no simulator: quoting bigger brings in a little less than proportionally more volume, and the profit on each lot does not shrink.11
The question. Everyone on a desk has a view on order size. Bigger orders trade more, but do they trade worse? A simulator cannot answer that, because it cannot know where a larger order really sits in the queue. So I measured it on what the desk had actually traded.
What I found. Fills grew a little less than in proportion to size, and profit per lot did not fall. Scaling size, under a hard cap on inventory, was worth far more than timing it.
What changed. The desk then scaled its live-hog quoting size several-fold on that finding.11
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.
Under the hoodThe elasticity regression, the invariance test and what was ruled out
In the desk’s engine, order size feeds several other controls at once, so “pick a size” needed a study on the desk’s own fills and could not be read off a simulator.
Volume elasticity
A log-log regression of lots filled per minute on the order size in force, with day and hour-of-day fixed effects and order-book controls (market volume, spread, depth, realized volatility, imbalance, position), standard errors clustered by day. The elasticity is measured, not modeled, so it already embodies queue position, partial fills and allocation. It is trusted only over the range of sizes it was measured on.
def elasticity(minutes):
rows = [m for m in minutes if m.market_volume > 0 and m.lots_filled > 0]
X, y = [], []
for m in rows:
x = [1.0, log(m.order_size)] # the coefficient of interest
x += one_hot(m.day) + one_hot(m.hour) # day and hour-of-day fixed effects
x += book_controls(m) # volume, spread, depth, volatility, imbalance, position
X.append(x)
y.append(log(m.lots_filled))
fit = least_squares(X, y, cluster=[m.day for m in rows]) # errors clustered by day
return fit.coefficient[1], fit.standard_error[1]Is profit per lot invariant in size?
The same panel, with the 5-second mark-out per lot as the outcome: the slope on log size is statistically zero. It could still fail at the moment a decision is made, so I measured it again at the start of each ten-minute decision block, where it was flat to rising across the range measured.
Two ways the elasticity could flatter the policy were tested inside the data: a lower elasticity in the thin, quiet minutes the policy loads into, and a lower elasticity at high sizes. Thin books showed no penalty and quiet minutes only a small one, there was no decline with size level, and the elasticity rises the longer a setting has been in force.
Volume elasticity by slice of the data
Fills grow strongly with size in every slice of the data, from 0.57 to 0.73 in this illustration, and the response does not weaken at the largest sizes.
Show the dataHide the data
| Slice | Estimate | 95% interval | s.e. |
|---|---|---|---|
| All minutes | +0.68 | 0.64 to 0.72 | 0.02 |
| Quiet market | +0.65 | 0.57 to 0.73 | 0.04 |
| Middle market | +0.68 | 0.59 to 0.77 | 0.04 |
| Busy market | +0.64 | 0.56 to 0.72 | 0.04 |
| Thin book | +0.70 | 0.64 to 0.76 | 0.03 |
| Middle book | +0.71 | 0.65 to 0.77 | 0.03 |
| Thick book | +0.68 | 0.62 to 0.74 | 0.03 |
| Size 1–10 lots | +0.60 | 0.44 to 0.76 | 0.08 |
| Size 11–20 lots | +0.57 | 0.39 to 0.75 | 0.09 |
| Size 21–30 lots | +0.73 | 0.55 to 0.91 | 0.09 |
| Size 31–40 lots | +0.68 | 0.48 to 0.88 | 0.10 |
| Quantity | Verdict |
|---|---|
| Volume elasticity η, pooled | a little below 1, tightly estimated |
| η by time the setting has been in force | rises the longer a setting has stood |
| Slope of per-lot mark-out on log size | not significant: no decline |
| Slope at decision time, 30-second mark-out | not significant: not negative |
| Scaling against timing | size under the cap matters far more than timing |
| A hard inventory cap | costs little profit for much less tail exposure |
What it does not claim
The study validated size-invariance only over the range of sizes in its data. The desk’s later sizes are its own scaling of the finding, and sizing at those levels needs more manual control, which is why CHRONOS now runs selectively.7 No profit figure is claimed for the change. Rejected along the way: depth-scaled sizing (worse than the shipped rule at every scale), stopping when the model is pessimistic, and recency-weighted training (none of 67 day-weighting designs beat uniform weights significantly).
05SPD Parameter Optimizer · profit maximization by exhaustive search
Every tradable spread, every parameter cell, backtested. The desk traded its picks.
For one commodity at a time, my optimizer backtests the desk’s spread strategy on every exchange-listed calendar spread and every combination of quoting parameters, and returns the most profitable configurations. The desk traded its picks.12
The problem. A calendar spread is a bet on the gap between two delivery months of the same commodity. I suspected the strategy’s settings, not the idea, and a sweep of my own showed it: the backtested result swung with the quote distance, and the best values sat well away from the default.
What I built. One morning’s work turned that hunch into a search. It screens every pair the exchange lists, sweeps a full grid of quote edge, withdraw distance, inventory skew and lookback on each survivor, cuts the weaker half as more days arrive, refines around the leaders, and extends the grid whenever a leader sits on its edge. A market maker’s volume is limited by exchange rules and risk limits, so it ranks on two goals at once: total profit and profit per lot. Every winning row is re-run by a second, independent driver and must match.
What changed. The desk traded the optimizer’s picks.12
What the backtest got for free. A backtest that closes flat every session carries inventory at no cost, so an unconstrained search favors settings that never lean against their inventory. I made leaning against inventory a hard constraint in every stage, and the field split cleanly: spreads that earn from quoting kept most of their result, those that had only been carrying inventory lost most of it. A shopkeeper who never marks down overstock looks profitable on paper until the stockroom overflows.
The engine underneath is mine too. The search runs on a backtester I rebuilt from a written specification of a colleague’s spread model, matching its results exactly, then scaled into a research engine that screened 12 commodities on months of recorded tick data. Its queue-based fill model reproduces 85–96% of live volume with no tuning, and the desk adopted the settings it picked for live trading.13 Open the backtester page
One commodity through the search
Synthetic data. An illustrative run of the optimizer’s procedure, step by step, on one generated commodity: every count, cut and curve comes from that run, not from a desk run, and all results are backtests. The last step is stated in words: the desk traded the optimizer’s picks; which configurations, when, and their results are confidential.
Text description of this figure
Three panels follow one generated commodity through the optimizer, step by step; every count comes from that synthetic run. Panel one, which pairs can be traded: of 11 contracts, 3 in or near delivery are dropped. The 3 most-traded contracts each serve as the trigger leg against each of the 7 other contracts, giving 21 pairings. Only 12 of them are listed by the exchange as a spread contract; the other 9 are hatched because they cannot be quoted. A 3-day screen at 4 quote edges and 4 lookbacks per pair keeps the union of the top half by total and the top half by profit per lot, 7 pairs, which finish the remaining 27 days, and 4 pairs are shortlisted. Panel two, the parameter grid: one block per shortlisted pair, labeled Spread A to Spread D, each 12 quote edges wide and 12 rows deep (3 withdraw distances times 4 inventory-skew levels). Twelve cells per block are hatched because the withdraw distance must be smaller than the quote edge, leaving 132 cells per pair and 528 configurations, each replayed at 3 or 4 lookbacks on the FakeSPD engine. The skew axis starts at a floor tied to the quote edge and never reaches zero, because a backtest carries inventory for free and live trading does not; trade size and quote levels are held fixed, and since skew is set per lot its axis already spans size. All four blocks are swept in parallel on the first 3 days (5,544 backtests), and a marker follows the leader by total as it changes hands. Because a market maker’s volume is limited, profit per lot is a goal of its own: the search keeps the top half by total profit together with the top half by profit per lot, 292 configurations rather than 264, and runs them to day 6 (3,027 backtests); the same cut leaves 234 for the remaining 24 days (18,744 backtests), and the early leader is overtaken. The search then refines at half steps around each pair’s leaders and extends the grid when a leader sits on its edge. A curve of the best result found so far rises against the number of backtests run, which ends at 63,435 for this one commodity. Panel three: a 22-row frontier becomes a ranked menu of 3 spreads (Spread A, Spread B and Spread C) with 5 settings each, running from most total profit to most profit per lot, and every row is re-run by a second, independent driver and required to match. Held-out days: every menu row is replayed unchanged on the 12 trading days before the search window, and all 15 stay profitable; the top row keeps 61% of its profit per lot, the widest-quote rows less. In use: the desk traded the optimizer’s picks; which configurations, when, and their results are confidential and are not part of this illustration.
One constraint separated quoting income from inventory bets
Each bar is one spread’s best backtest with the skew floor, as a share of its best without it.
Result kept under the skew floor, by spread
Spreads that earn from quoting kept most of their result under the floor; the ones that had been carrying inventory kept a small fraction.
Show the dataHide the data
| Calendar spread | Result kept (%) |
|---|---|
| Spread A | 82% |
| Spread B | 78% |
| Spread C | 74% |
| Spread D | 69% |
| Spread E | 64% |
| Spread F | 14% |
| Spread G | 14% |
| Spread H | 13% |
| Spread I | 12% |
Under the hoodObjectives, the staged search, guardrails, compute and code
The problem, formally
Maximize total profit and profit per lot jointly over the listed pairs and the parameter grid; the result is a Pareto front, read at a volume target. There is no fee term. Constraints: only spreads the exchange lists, contracts in or near delivery excluded, the trigger leg among the three most-traded contracts, withdraw distance below the quote edge, a statistical floor on lots per day, and a floor on inventory skew tied to the quote edge.
The staged search
- Audit. Tick coverage per contract and day; tick size inferred from the price grid and checked against the reference data; delivery rules.
- Pair screen. Every ordered listed pair on the first third of days; pairs halved, survivors finished.
- Coarse grid. Every cell on each shortlisted pair; successive halving over three blocks of days, keeping the union of the top half by total profit and the top half by profit per lot, which is why, in the synthetic run above, 528 configurations become 292 and then 234 rather than 264 and 132.
- Refinement. Half-step neighborhoods around each pair’s leaders, with boundary auto-extension up to four passes.
- Validation. Four consecutive day blocks per row, rank stability, neighborhood averages, and a re-run of every reported row by an independent fixed-pair driver.
Why a transparent grid and not Bayesian optimization or a gradient method: the objective is a step function of the quote edge, because quotes round to the tick, and it is noisy; the runtime has no numerical libraries; and a grid’s cost is known before it starts. Dropping configurations early is legitimate because profit is additive over days and each day is replayed independently; the price is a winner’s curse on about a thousand noisy estimates, which the stability checks are there to counter.
def union_of_halves(alive, days_seen, keep=0.5):
"""Keep the top half by total profit AND the top half by profit per lot."""
total, per_lot = {}, {}
for config, lookbacks in alive.items():
r = best_over(lookbacks, config, days_seen)
total[config] = r.total
if r.lots_per_day >= MIN_LOTS_PER_DAY: # per lot only where volume means something
per_lot[config] = r.per_lot
n = max(4, ceil(len(alive) * keep))
kept = top_n(total, n) | top_n(per_lot, n) # the union: more than half survives
return {c: alive[c] for c in kept}
# grid stage: every cell on the first block, then days only for survivors
days_seen = []
for i, block in enumerate(day_blocks):
run_backtests(alive, block) # configurations x lookbacks x days
days_seen += block
if i < len(day_blocks) - 1:
alive = union_of_halves(alive, days_seen)Scale and verdicts
| Item | Figure |
|---|---|
| Search evaluations, three six-product cycles | 600,000+ |
| Reported rows reproduced by the independent driver | 747 of 747 |
| Hold-out | Every recommended row profitable on days the search never saw |
| Benchmark throughput | 129,168 evaluations in 146.6 minutes on 16 worker processes |
| Adoption | The desk traded the optimizer’s picks12 |
Guardrails a search needs
A search exploits whatever the model rewards, so each artifact it found became a rule.
- A contract in its delivery month has a one-sided book and a meaningless mid price: automatic delivery exclusion and a per-lot plausibility scan.
- One product’s first winner was a pair the exchange does not list as a spread. I caught it, and listed-only became a constraint before screening.
- Optima on the grid edge: boundary auto-extension.
- Free inventory in the backtest: a skew floor tied to the quote edge, enforced in every stage; under it, spreads that earn from quoting kept most of their result and those that had earned by carrying inventory lost most of it.
- On another exchange, winners that depended on reading one leg a snapshot stale, or on unlisted spreads that must be legged: I showed both biases and recommended not trading them.
One honest limit: an independent re-run reproduces artifacts too. Only plausibility, day-concentration and inventory checks catch them. Apart from the formal hold-out, results are in-sample.
06Live versus backtest · an exact replica and what it revealed
Late by a fraction of a second, a short-horizon signal turns from gain to loss. My analysis led the desk to give its live-hog engine a server of its own.
The desk’s simulator credited its machine-learning signal with a large gain that live trading did not deliver. I rebuilt the simulator until it matched fill for fill, then found out why.
The problem. A backtest and the live desk disagreed, and nobody could say which was wrong. The price signal is the model team’s work. The question, why live results trailed the backtest with the same signal, was mine.
What I built. A replica of the desk’s backtester that reproduces it exactly: every day and configuration tested equal, and every fill of a full benchmark day identical in time, price, size and side.14 My first port was 3.7% off and blamed a setting for the gap. I refused that explanation, and a reference fill file showed what the port had missed. On an exact engine I could ask one clean question: what if the signal reaches the trading engine one market snapshot late?
What I found. The answer was not a smaller gain but a loss against using no signal at all. Delayed by a single 250-millisecond snapshot, the backtested uplift turns negative. The whole advantage exists only for an engine that acts instantly. A tip about where a price is heading in the next half-second is valuable if you act at once and costly a beat later, when you are chasing a move that already happened.
What changed. After my report, the desk gave its live-hog engine a server of its own.15
And then I audited my own result. My follow-up audit, a difference-in-differences against a frozen control, found the order round trip slower afterward and credited no gain to the move. I reported exactly that.
Then I automated the answer. The order-by-order audit became a daily report, in production since August 25, 2026: every live order is replayed through a bit-exact replica of the desk’s backtest matcher and through my improved one. The daily audit found a consistent optimistic bias in the backtest, and an improved matching rule cut it substantially.16 Open the daily report
The delay cliff
Synthetic data. Illustrative values, generated to show the effect: the uplift is full only at zero delay and negative from the first 250 ms snapshot. The method is as built; the desk’s own figures are confidential. The straight lines between the five delays are schematic. The price signal is the model team’s; the replica, the delay test and the order audit are mine.
Text description of this figure
The figure has three stages, all on synthetic values. Stage one, the replica: my Python port of the desk’s backtester is reconciled until it matches, shown as a grid of 24 runs (12 days times 2 configurations) that turn green one by one and a counter that reaches 1,684 of 1,684 identical fills on a benchmark day. Stage two, the delay test: the machine-learning signal is shifted later on that engine. Used instantly the signal has an information coefficient of 0.360 and the backtest shows its full uplift, 100 percent. One 250 millisecond snapshot late the coefficient is 0.123 and the uplift is minus 40 percent, below using no signal. At 0.5, 1 and 2 seconds the uplift is minus 76, minus 98 and minus 109 percent, and the coefficient falls to 0.057, 0.024 and 0.004. Stage three, the result: after the report, the desk gave its live-hog engine a server of its own, and my follow-up audit credited no gain to the move. The last step shows the order audit: live orders replayed through the backtest’s matching rules fill 25 percent fewer lots yet book 1.46 times the value 30 seconds later, because cross orders that missed live and orders already canceled live still fill in the backtest.
Under the hoodSignal decay, the counterfactual, the order-fate audit and the matching fix
Signal decay and the counterfactual
On the 250-millisecond grid of the signal files, the information coefficient is the correlation between the signal and the mid-price move over the next half second, measured after a delay . Then, on the exact replica, every signal timestamp is shifted by and the uplift is the average profit per lot with the signal minus the same backtest without it, as a share of its zero-delay value. Parity came first; without a bit-exact engine the shift would measure porting error.
| Delay | Information coefficient | Uplift, share of zero-delay |
|---|---|---|
| 0 s | 0.360 | 100% |
| 0.25 s (one snapshot) | 0.123 | −40% |
| 0.5 s | 0.057 | −76% |
| 1 s | 0.024 | −98% |
| 2 s | 0.004 | −109% |
One order, two worlds
To find where the backtest over-credits, I pushed every live order, with its own lifetime from the engine’s nanosecond log, through the backtest’s matching rules and classified its fate in both worlds. Placement matched the backtest’s own formula, but the backtest filled fewer lots and credited far more value.
The mechanism, which I proposed and the data confirmed: other participants’ orders landing in the same 250-millisecond window can sit ahead of ours, invisible to a snapshot backtest. Most early fills had rivals joining the same price inside the same 250 ms window; the rest come from a volume-allocation rule that burns the queue faster than the market.
The fix, packaged for the model team
A one-time queue-join correction at the first snapshot after an order is created, plus a tick-grid volume allocation. Setting the correction to zero reproduces the original engine bit for bit. The queue-join correction alone removes most of the over-credit; with the tick-grid allocation the timing-error tail falls sharply. It went to the model team’s developers as a drop-in patch with self-tests, which the model team adopted, and a colleague’s independent allocation rewrite proved identical to my grid rule on every market slice compared.
Auditing the server move
One-clock latency: order acknowledgment is the time from insert to the first exchange return carrying an order id, both stamped by the same clock, split into an engine-local leg and an exchange leg. Performance is live minus a same-day backtest under a frozen control configuration, in difference-in-differences, then a regression with a post-move dummy and the main confound as a control, with matched day pairs as a cross-check. The audit found the order round trip slower afterward, and the report rules that no gain may be credited to the move.
07Strategy One · fleet control platform
A window per trading machine became one screen. Idea to a working run on the live machines: under two hours.
I conceived, designed and built the platform the desk uses to switch, resize, edit and stop its high-frequency strategies on every exchange-colocated trading machine at once.
The problem. The trading engines run on machines beside the exchanges, in Dalian and Shanghai. A trader reaches them only through Remote Desktop, one window per machine. When a contract jumped I had to find the right window, open its editor, change one value and save, then do it again elsewhere.
What I built. One screen that shows and controls every strategy on every machine: run, pause, stop, size and every parameter, adding and deleting strategies, and one click that stops everything. The trading machines are locked down by design: the only access from the office is Remote Desktop, with no admin rights. Strategy One works entirely within that access, exchanging small command files through Remote Desktop’s own shared-folder feature, with no new ports and nothing installed. Risk guards that cannot wait for a human run on each trading machine every second, even with the hub closed.
What changed. I described the idea at 09:46 on July 31, 2026. At 11:33 it ran on the live machines. From its first week of live use it carried dozens of confirmed change batches a day, and none failed.17 It has since grown through about 68 builds into the desk’s daily control path, shipped as signed executables that update themselves across the fleet and roll a bad release back on their own.
In daily use from its first week
A batch counts as confirmed only when the trading machine has written the change and read it back. Every batch in its first weeks of live use was confirmed; the chart shows that pattern with illustrative daily counts.
Change batches confirmed per trading day (illustrative)
Every one of 773 illustrative batches confirmed: 76 to 120 on each of eight trading days, and none failed.
| Trading day | Change batches, all confirmed |
|---|---|
| Day 1 | 98 |
| Day 2 | 76 |
| Day 3 | 118 |
| Day 4 | 101 |
| Day 5 | 76 |
| Day 6 | 100 |
| Day 7 | 120 |
| Day 8 | 84 |
It also tells you how each contract is doing
Each trading machine’s agent reads its engine’s own log and streams profit, lots, book depth and market share to the hub at no extra network cost. The hub draws them on a trading-time axis with the breaks cut out.
This view compares contracts minute by minute in profit per lot: where the money was made, where it was given back, and which contracts were not running. A full trading day’s engine logs replayed: 1,429 of 1,429 heartbeats equal to an independent model.
Enlarge
- Marker 1: Per lot today (top right): the selected contracts’ profit divided by their lots.
- Marker 2: Contract chips: up to seven contracts from any machines on one axis.
- Marker 3: One bar per minute: that minute’s profit divided by its lots; green earned, red gave back.
- Marker 4: Hatched gaps: exchange breaks, cut out of the axis so sessions sit side by side.
- Marker 5: Dotted stretch: the contract was not running.
- Marker 6: Last 15 minutes (right panel): the same bars magnified for the stretch being traded now.
Under the hoodTransport, the round trip of one change, crash-proof writes, signed updates and code
Strategy One is the trader’s control plane, not the order path. The engines keep quoting at exchange speed on their own machines; a human decision reaches them in one to three seconds instead of tens; and the guards that cannot wait for a human run on each machine every second.
Transport: files over Remote Desktop
Strategy One works within the desk’s existing Remote Desktop access: the hub and a tray agent on each machine exchange small files through Remote Desktop’s own shared-folder feature, with no new ports and nothing installed. One change is a small transaction:
- The hub writes a command holding the new content and the version of the file the page edited.
- The agent refuses it if the file has changed since (a stale edit never lands), otherwise writes a temporary file, flushes it to disk, swaps it in atomically and reads it back byte for byte.
- The agent acknowledges first, then publishes the fresh copy. The page marks the batch confirmed with its duration, or re-reads the real file and re-sends.
- If another writer moved the same field in the meantime, such as CHRONOS’s loss brake, the hub holds the edit in red instead of silently undoing a risk action.
Crash-proof writes
A crash on a trading machine once left a just-saved file as zeros; since then every temporary file is written through and flushed before the swap, so a crash at any moment leaves the old complete file or the new complete file. The swap itself stays one plain atomic replace, and the agent never holds a file the engine watches.
def atomic_save(path, new_bytes):
temp = sibling_temp_name(path) # same directory as the target
with open_write_through(temp) as f: # bypass the file cache
f.write(new_bytes)
f.flush_to_disk() # on disk before the swap
for attempt in range(RETRIES):
if replace(temp, path): # one atomic replace: old file or new file
break
wait_briefly()
else:
delete(temp)
raise SaveRefused("file unchanged: it still holds the previous complete version")
if read_bytes(path) != new_bytes: # read back, byte for byte
raise VerificationFailed()
return modified_time(path) # the version the next edit must matchOn-machine risk and signed updates
- Guards on the machine. Per-strategy rules on rolling loss windows, traded lots and market share are checked every second and act within a second, with the hub closed or Remote Desktop down. A guard that fires switches itself off, and spreads auto-park before each session close.
- Signed, self-updating builds. Each of the three applications is one Authenticode-signed executable, built with the compiler that ships with Windows. An update is refused unless it is signed by a pinned key, is staged and applied only at the next launch, and is rolled back and blocklisted automatically if it fails a health window. I proved it outside trading hours with a deliberately broken signed build: all three applications reverted on their own and blocklisted it.
- Never fail silently. A configuration the page cannot parse gets a card with the parser’s line and column; an empty one says it is empty.
| Measure | Figure |
|---|---|
| Idea to working run on the live machines | under 2 hours (Jul 31, 2026) |
| Change batches in its first weeks of live use | dozens a day, every one confirmed, none failed17 |
| Confirmation time, first attempt (median) | about 1 s at the Shanghai site, about 3 s at the Dalian site |
| A full trading day’s engine logs replayed | 1,429 of 1,429 heartbeats equal to an independent model |
| Builds | about 68 in three and a half months |
| Releases delivered by signed self-update | five fleet-wide updates in one week (Nov 6 to Nov 12, 2026), with no machine visits; one major release went from specification to every machine in under two hours |
| Code | about 37,000 lines across hub, agent and console, with no third-party libraries |
08Position Atlas · Self-Trade Check · exchange-obligation analytics
I turned an ambiguous exchange rule into software that matches the exchanges on 2,410 contract-days out of 2,410, and built the surveillance that traces every self-trade to its cause.
The open interest that counts feeds the exchange’s evaluation of its market makers. I built the tools that tell every trader on the desk how much counts, and why some of it does not.
The problem. An exchange-designated market maker must hold a minimum average open interest in each designated contract, and positions formed when the desk’s own buy order meets its own sell order do not count toward it. The trading terminal shows neither figure, and the daily tally was kept by hand in a spreadsheet.
Position Atlas. In my first week I saw that daily chore and offered to automate it. Version 1.0 shipped on July 9, 2026, eight days after I joined. It reads the statements, computes each contract’s open interest and month-to-date average, and forecasts the average still needed on each remaining day. In November I added the exchanges’ self-trade deduction. The written rule can be read three ways; I tested each against the exchanges’ own obligation reports. One matched on 2,410 of 2,410 contract-days, and the other two failed.6
Self-Trade Check. Self-trades, unintended matches between a spread order’s exchange-derived legs and the desk’s own quotes, do not count toward a market maker’s eligible open interest. I built the surveillance: a verified count of a whole month of trade records 38 minutes after I started, a production report after every session within 48 hours, and every self-trade I traced explained by one of two mechanisms of the exchange’s spread matching, with none left unexplained.18
What changed. The desk now sees its obligation position and its self-trade matches every day instead of at month end, with the evidence for each deduction one click away. The attribution runs by itself after every close, so traders see at once which parameter and strategy changes reduce these matches.
What a self-trade costs, and for how long
Effective open interest: what a self-trade costs, and for how long
Synthetic data. The ten-day ledger, the 40-lot minimum and the three-readings replay are illustrative, generated to show the effect. The rule is as built: effective = long + short − 2 × lots of every self-trade in which both sides opened, carried for the life of the contract. On the exchanges’ own obligation reports that rule matched 2,410 of 2,410 contract-days; the desk’s own figures are confidential.
Text description of this figure
The figure walks through one contract over a short illustrative month in four panels. Panel 1, the ledger: each day’s long and short positions and their sum, with a marker on days when the desk traded with itself. Panel 2, the exchange’s rule: effective equals long plus short minus the sum of 2q, where q is the lots of every self-trade so far in which both sides opened. A self-trade where both sides open adds 2q to the running deduction; a pair where one side opens and the other closes adds nothing. On the Shanghai exchanges the deduction is carried on every later day of the contract and never floored at zero; for Dalian it is modeled as deducted once, on the day, and labeled presumed. Panel 3, what the exchange counts: daily bars split into the part that counts and the part deducted, with the plain average and the effective average shown against the minimum. Holding the usual position for the rest of the month ends with a plain average of 45.0 and an effective average of 39.2, below the 40-lot minimum; holding the raw-to-hold figure that Position Atlas computes (46.7 lots a day, so 48) finishes the month at 40.4. Panel 4, the proof: checked against the exchanges’ own obligation reports, the shipped reading matched 2,410 of 2,410 contract-days. Beside it, three readings of the same written rule are replayed on a synthetic test set of 1,680 contract-days: both sides opened at 2 × lots matches all of them; both sides opened at 1 × lots misses 63; every opening side misses 71.
The exchange turns the desk’s own spread order into an order nobody can see.
How a self-trade happens, and how each one is labeled
Synthetic data. Illustrative orders, prices, sizes and shares, generated to show the effect; months A, B and C stand for three delivery months of one commodity. The mechanism and the labeling rules are as built; the desk’s own orders and figures are confidential.
Text description of this figure
Three panels and a strip (on a phone, four tabs shown one at a time). Panel one shows an order the desk rests at the exchange: buy a calendar spread, months A and B, 8 lots at a price gap of minus 42, which means buy month A and sell month B. The exchange derives from it a sell order in month B priced at month A’s price plus 42, here 8,170 plus 42, which is 8,212. The desk’s ordinary bids and offers in month B are managed separately from the spread order, so the quoting side cannot see the spread’s derived leg. Panel two is the month B order book; the derived sell is drawn with a dashed outline because no screen displays it. In the first case the desk’s own quoting engine, which cannot see that order, bids 8,212 for 2 lots and the two match: buyer and seller are both the desk, one trade ID, a self-trade. In the second case the desk’s bid is already resting at 8,212 while the hidden sell is at 8,218; 6 seconds later month A falls from 8,176 to 8,170, the hidden sell slides to 8,212 and matches the resting bid although nobody sent an order. In the third case two spread orders in the same direction, A and B, and B and C, share the middle month; the exchange derives a hidden sell and a hidden buy in month B and matches them at 8,200 for 3 lots. Panel three is the tool’s label, with each mechanism’s share of a generated sample of 250 pairs: M1 instant, 13 percent; M1 drift, 49 percent; M2 shared leg, 38 percent; anomaly, 0 percent. A bar chart gives the trigger delay of the sample’s M1 pairs: 21 percent in the same second, 27 percent within 1 to 10 seconds, 32 percent within 11 to 60 seconds, 19 percent within 1 to 10 minutes and 1 percent after more than 10 minutes; median 14 seconds. A pair that fits neither mechanism, such as two ordinary orders from one account, is flagged for a person and never forced into a category. The strip explains why a market maker measures every one: positions formed by self-trades do not count toward the open interest a market maker is evaluated on; they come from how the exchange matches spread orders, so most happen while both orders rest; and a derived order is on no screen, so the reliable control is to measure and trace every pair after each session. All orders, prices and shares in the figure are synthetic.
Under the hoodThe deduction rule, how it was identified, the two mechanisms and code
Effective open interest
A self-trade is one exchange trade number that appears twice in our own account on the same day, once as a buy and once as a sell. Each pair is classified by the open or close flag of its two sides: both open (long and short each rise by ), mixed (net zero), or both close.
On the Shanghai exchanges the rule that matches is: deduct twice the lots of every both-open self-trade , from the day of the trade for the rest of the contract’s life, never floored at zero. The remaining daily need then has to cover the running deduction as well. The evaluation month also differs by exchange (Shanghai’s is offset from the calendar month), and a contract listed mid-month is assessed from its listing day; both are encoded.
def classify(pair):
"""A pair is two fills of one exchange trade number in our own account."""
opening_sides = int(pair.buy.opens) + int(pair.sell.opens)
kind = {2: "both open", 1: "mixed", 0: "both close"}[opening_sides]
return kind, opening_sides, pair.buy.lots
def deduction(day_totals, reading):
both_open = day_totals.both_open_lots # lots of pairs in which both sides opened
if reading == "one_times":
return both_open
if reading == "two_times": # the reading that matched the exchanges
return 2 * both_open
return day_totals.opening_side_lots # the literal text: every opening sideIdentifying the rule from data
The ledger behind it is rebuilt from 489 daily settlement statements and cross-checked trade by trade against same-day trade exports; any disagreement is an alert and the statement wins. An unpaired or mismatched row marks the day as a data error instead of being silently counted. The Dalian treatment (deducted once, on the day) is a presumption, labeled as such in the tool, because Dalian’s daily figures carry no deduction to check against.
| Reading of the rule | Contract-days matched | Wrong |
|---|---|---|
| Both-open self-trades, twice the lots, carried forward | 1,680 of 1,680 | 0 |
| Both-open self-trades, lots counted once | 1,617 | 63 |
| Every opening side | 1,609 | 71 |
Two mechanisms behind every self-trade traced
Joining both sides of each pair to their originating orders showed two structural causes, both from the exchange’s derived matching of spread orders.
- M1. Our own outright order meets the derived leg of our own resting spread order; the derived order is not displayed, and the quoting side cannot see it because spread orders and quotes are managed separately. Most M1 collisions happen while both orders rest, so a check at order entry would miss most of them.
- M2. Two same-direction spreads on adjacent month pairs cross on the month they share.
None was left unexplained. The daily automation reproduces the manual study and flags any pair that fits neither mechanism for a person, never forcing it into a category.
Built to be trusted
- Fail loud. Export checksums, mirror assertions and an independent recount; a month without a designated-contract list turns the reports red instead of silently using an old one.
- Scanned exchange notices. The monthly list of designated contracts is decoded from scanned PDFs by a decoder that must first reproduce the previous month exactly.
- Delivery. Reports go to the desk’s group chat through Windows UI automation with recipient and send verification, because the chat client has no API here; a full-day report after every trading day since launch.
- Shipping. Position Atlas is one signed, self-updating executable for every trader, with 129 automated regression tests; raw exports stayed byte-identical across releases.
09Smart-queue review · code review, valuation and a guard in production
I reviewed the engine team’s new strategy line by line, showed where its value really came from, and redesigned the guard now running in production.
Fifteen review findings, each with file and line, before it traded live. Months of market history replayed on a replica identical to the reference simulator, 27 of 27 rows. A guard priced on the desk’s own fills and running in production.19 A full specification the engine team built from.
The problem. A market maker’s orders wait in line at each price, first come, first served. The engine team’s new strategy rejoins the line the moment part of our order has traded, instead of waiting for the rest to fill. It sounds like free speed. The strategy and its C++ are theirs; the question of what it is worth was mine.
What I did. My line-by-line review before go-live reported 15 findings, each with file and line, to the engine team. I replayed months of market history on a replica identical to the reference simulator. The rule looked profitable, but most of the simulated gain came from inventory-scaled size; the earlier place in the queue was worth almost nothing.20
The thin-book guard. Where the simulator could not be trusted, I priced the thin-book guard on the desk’s own historical fills. In a thin book a resting order fills mostly when the whole level is being swept. The floor-and-cap guard on other traders’ depth that I designed was implemented by the engine team and runs in production.19
When it went live. I reconstructed the strategy’s first live session order by order, reconciled exactly to the desk’s records, and showed the backtest had mispriced top-up fills in thin books. I scored 88 candidate rules on the logged top-up orders. Weeks later I scored the redesign on the same orders, showed the no-flip check must run after the add is sized, and wrote the 16-step specification the engine team built from.
It is like rejoining the supermarket queue before you have finished paying. You do reach the till again sooner, but mostly at the moments when everyone behind you is abandoning the queue.
Getting in line early, and the guard for a thin book
Synthetic data. Mechanism as built; every number in this figure is illustrative. The queues (a 10-lot order; 28, 12 and 40 lots from other traders), the bar chart and the gauge are drawn to show the effect. The guard’s settings are not shown, and the desk’s own figures are confidential.
Text description of this figure
Three panels. Panel one, queue early: under the old rule, one order per price, buyers take 7 of the desk’s 10 lots and the last 3 must trade before the engine lines up again; under the engine team’s smart-queue strategy, 10 more lots join the back of the line at once. Facts: my paired A/B replay switched one rule at a time; my replica matched the reference simulator row for row before any rule changed; most of the simulated gain came from size, not queue place, and the head start in line was worth almost nothing. Panel two, the thin book: the same top-up at a level where other traders show only 12 lots, 1.2 times the desk’s order size. One buyer takes all 25 lots, the top-up fills last, the price steps up a tick and the desk’s position flips from plus 3 to minus 10. An illustrative bar chart shows indexed fill quality five seconds after a fill in seven buckets from the thinnest level to the deepest, relative to the desk’s order size: −37, −38, −26, −2, +31, +65, +100, so thin levels lose on average and deep ones earn. The study priced this on the desk’s historical fills, not on the simulator. Panel three, the guard: it counts only other traders’ lots, 22 displayed minus the desk’s own 10 leaves 12, which is below the floor, so the engine cancels the desk’s 10 lots at that price before a sweep; when other traders refill the level to 40 lots the quote returns. Facts: the guard reads other traders’ depth only; its threshold is a multiple of the order size held between a floor and a cap; it was adopted in production.
Under the hoodThe replay engine, the valuation, pricing on fills, the rule tests and code
A replay engine that can be trusted
A line-exact port of the model team’s reference backtest, re-expressed with switchable arms and verified on 27 of 27 rows; inputs are the desk’s historical intraday size schedules and the production price signal, over months of market history across several contracts. The modeling fix that mattered: a queue model written for one order per price can let two of our own orders at that price share a queue position, which over-credits any strategy that stacks orders. Enforcing first-in-first-out between our own orders leaves the baseline unchanged to within rounding, and it was found because verification failed on 10 of 27 rows once it was switched on, so a replica arm keeps the reference rule for the 27-row check.
# Two of our own orders at one price cannot share a place in the queue.
for each (side, price) level that holds two or more of our orders:
sort the level's orders by arrival
for each order after the first:
minimum_ahead = previous.queue_ahead + previous.lots_left
order.queue_ahead = max(order.queue_ahead, minimum_ahead)Valuation
Every comparison is paired by trading day on the same tape: t-statistic, share of positive days, worst day. A sensitivity parameter lets same-snapshot arrivals queue ahead of us, and the value is decomposed into a queue-priority part and an inventory-scaled-size part.
| Finding | Evidence |
|---|---|
| The mechanism has simulated value | paired by trading day on the same tape, across months of market history |
| Where the value comes from | mostly inventory-scaled size; the pure queue restart is not significant on mark-out and vanishes under a conservative queue assumption |
| Value rises with book depth | monotone across depth quartiles |
| Candidate rules | 88 candidate rules on the logged top-up orders; a traded-flow gate kept far more fills than the rules that worked by switching top-ups off |
Where the simulator has the wrong sign
A snapshot model never lets anyone react to our own order, and in a thin book our order is a large share of the level. So the guard was priced on the desk’s historical passive fills by the ratio of depth to our order size: fills at levels that are thin relative to our order size lose money five seconds later, and deeper ones earn.
One multiple is not enough. The best multiple falls as size grows, because the threshold grows linearly with size and book depth does not: a flat multiple switches off a large share of quoting time at the larger sizes; a floor and a cap do not. Depth is measured excluding our own resting lots, which were a sizable share of the touch; counting them would let a bigger quote pass its own safety test. The guard acts only on the side that would add to our position; the side that reduces it is exempt.
| Check on historical fills | Result |
|---|---|
| Sample | Months of the desk’s passive fills across several contracts |
| Clamped rule on external depth | Tested day by day, with a split-sample check |
| External depth versus total depth | Discriminates better |
Specification
The engine team asked for a complete standalone requirements description rather than a list of changes. I wrote it: per-tick behavior in 16 steps, four new parameters, the definitions of traded flow and unknown order state, logging for every decision so live days can be scored, and 12 acceptance cases. Their next build implements it, which I confirmed by reading the source.
10Timeline
Under five months, in order.
- Joined Nanhua FuturesTrader, Market Making Department, Hangzhou. Six Dalian Commodity Exchange products.
- First tools shipped, within two weeks of joiningStrategy Console (July 8), the open-interest tracker that became Position Atlas (July 9) and Spread Calculator (July 14).
- Strategy One: idea to live fleet in under two hoursDescribed at 09:46, running on the live trading machines at 11:33.
- Self-trade surveillance in production in 48 hoursA verified first count 38 minutes after I started, then a report after every trading session.
- The latency reportAn exact replica of the desk’s backtester shows the price signal’s backtested edge depends on acting within a fraction of a second. After it, the desk gave its live-hog engine a server of its own.15
- CHRONOS research beginsOn my own initiative, to replace a size dial turned by hand; the desk later scaled its live-hog quoting size several-fold on its finding.11
- Daily backtest audit in productionEvery live order replayed each day through the desk’s backtest matcher and my improved one.16
- Confirmed to full-time in two monthsA first at the firm.1
- CHRONOS liveRecommend-only, with me trading by its numbers.
- SPD Parameter Optimizer built in one morningEvery spread pair at every parameter setting, each winning row re-run by an independent driver. The desk went on to trade its picks.12
- CHRONOS closes the loopIt writes its sizing decisions into the trading engine by itself and reads every write back.
- Signed, self-updating executablesThe Strategy suite, then CHRONOS, ship as code-signed builds that update across the fleet and roll back a bad release on their own.
- The engine team builds from my specificationThe redesigned queue strategy, from my standalone requirements document: 16 steps, 4 new parameters and 12 acceptance cases.
- Took CFA Level IResult pending.21
- 2,410 of 2,410Position Atlas reproduces the exchanges’ own effective open-interest figures on every contract-day checked.6
11Credentials
Qualified for the market, trained as an economist.
China Futures Qualification Exam
Both subjects passed
The Futures Qualification Exam (期货从业资格考试) of the China Futures Association: both subjects passed.
CFA Level I
Taken November 17, 2026
Took the CFA Program Level I exam on November 17, 2026; result pending.21
Education
Columbia University · NYU Shanghai
M.A. in Economics, Columbia University (GPA 4.03). M.A. in Quantitative Methods in the Social Sciences, Columbia University (GPA 4.033). B.S. in Business and Finance, NYU Shanghai (Major GPA 3.95). Three peer-reviewed publications, two sole-authored. See Academia
12Software Development
The desk’s controls, checks and daily reports now run on software I wrote.
All 25 trading systems, desk tools and quant studies: conceived, designed and built from scratch, on my own initiative, by one trader for a live futures desk.
Each has its own page: architecture first, then every function, then the models, math and code.
13Contact
I am looking for my next team in New York.
Markets or applied AI, the work I want is the same: models judged on data they have never seen, and software that runs live. In markets, that is quantitative research, trading, strats, risk and markets technology at a bank, fund, trading firm or exchange. In applied AI, it is research, evaluation and machine-learning engineering on products real users depend on. I arrived on this desk with one undergraduate course in futures and options; within two months I was making markets in six futures and building the desk’s software. I learn a domain fast, go deeper than I was asked to, and ship what I find as software people use the next morning.
Reach me directly.
Email is fastest. I am glad to walk through any system or study on this page in detail.
- Emailshuo.huang@columbia.edu→
- Phoneon request
- Work statusCanadian citizen, eligible for TN work status
- LocationBased in Hangzhou, China; ready to relocate to New York
- 1Confirmation to full-time effective September 1, 2026, two months after joining in July 2026.
- 2The full projects listed in the Software index: trading platforms, desk tools, quant research and systems engineering, each designed and built by me; a few short cases are listed there separately. The exceptions to “from scratch, on my own initiative”: the Level-2 receiver is a Windows port of IT’s Linux demo; the spread backtester began as a rebuild of a colleague’s one-day script; Self-Trade Check began as a desk assignment; and several of the studies answered questions raised by colleagues. The trading engine these tools control, and its price signal, belong to the desk’s IT and model teams.
- 3Egg, coking coal, LLDPE, live hog, palm oil and soybean oil, all on the Dalian Commodity Exchange.
- 4Research from August 25, 2026; recommend-only from September 3; closed loop from September 15; 46 numbered versions between September 2 and September 24, 2026, counted from release headers.
- 5Twenty model variants on the same out-of-sample trading days, walk-forward, with hyperparameters fixed in advance; one of the 20 is a deliberate look-ahead control. The top models were a statistical tie on out-of-sample profit from sizing by their score at equal traded volume, so the simplest of them, a nine-input weighted least-squares regression, shipped. It re-fits itself every trading day. The scores in the tournament figure are synthetic.
- 6Effective open interest after the self-trade deduction, compared with the obligation reports of the Shanghai Futures Exchange and the Shanghai International Energy Exchange, scored by equality in whole lots. The scope of the test is confidential. The Dalian Commodity Exchange’s treatment is presumed, because its daily figures carry no deduction to check against.
- 7Since the desk moved to much larger quote sizes, sizing needs more manual control, so CHRONOS is switched on for contracts quoted at a steady size through the day.
- 8A 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; the engine tops resting quotes up to that minimum. The top-up is the engine’s own feature, built by desk IT.
- 9A walk-forward backtest measured by 5-second mark-out at equal traded volume. It is not live profit.
- 10Per 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.
- 11Measured 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 shows no decline with size. Quote sizes are the desk’s settings and are not published; no profit figure is claimed for the change.
- 12Each live configuration was a row of the optimizer’s output; the desk chose which rows to trade. Which configurations, when, and their results are confidential.
- 13Which settings, on which spreads and when, and the live results, are confidential. The strategy was designed by a colleague, the live strategy code is the desk engine’s, and going live was a desk decision.
- 14Total profit, total lots and total cancels equal on every day and configuration tested, and every fill of a full benchmark day identical in timestamp, price, size and side. The replica is my Python port of the desk’s backtester; the backtester itself is the model team’s.
- 15The decision was the desk’s. No speed or profit gain is claimed for the move: my own follow-up audit, a difference-in-differences against a frozen control, found the order round trip slower afterward and credited no gain to it.
- 16The matching rule audited is the model team’s; the improved rule combines my queue-join correction with a colleague’s volume allocation and a self-liquidity guard a colleague proposed; the replica, the replay, the report and its automation are mine. The desk’s own figures are confidential.
- 17From the platform’s own change log over its first weeks of live use: every batch was confirmed by a read-back of the machine’s file, and none failed. About five in six (84%) confirmed on the first attempt, the rest after automatic retries. The desk’s daily counts are confidential; the chart uses synthetic counts.
- 18Every self-trade pair of a multi-day sample, each joined by hand on both sides to its originating orders; the daily automation reproduces that manual study. Counts are confidential, and the orders in the figure are synthetic.
- 19The guard existed as a single multiple of order size. The floor, the cap and the switch to external depth came from my study of the desk’s historical passive fills; the engine team coded them, and the guard runs in production. No live before-and-after effect has been measured; the multiple, floor and cap are the desk’s settings and are not published.
- 20Simulated on months of live-hog market history with the desk’s historical intraday size schedules, on a replay engine that reproduces the desk’s reference simulator exactly (27 of 27 rows). Snapshot simulations over-credit fills at swept price levels, which is why the thin-book questions were priced on fills.
- 21CFA Institute does not endorse, promote or warrant the accuracy or quality of this site. CFA® is a registered trademark owned by CFA Institute.