The Order Book Edge

The Order Book Edge

Market Analysis

Compiled and Red: Five C++ Bots, a Hundred-Row Library, and a Copper Call Spread

Five generated C++ bots compiled on Sunday night, then lost money on HGZ6, MHGF7 and 6EZ6. The 100-row library still grades them B+ and A+. The honest trade is a defined-risk copper call spread.

The Order Book Edge's avatar
The Order Book Edge
Nov 30, 2026
∙ Paid
Cream-coloured hero with the headline 'Compiled and Red', five downward front-month P&L bars labelled the second exam, and an illustrative copper bull call spread payoff.

Hypothetical backtest research and education only. Nothing here is investment advice, a solicitation, or a recommendation to buy or sell any futures or options contract. Option diagrams and premiums are illustrative. Past or backtested results, including the figures in this pipeline run, are not a promise of future performance. I do not reveal the trading rules or parameters of the generated bots.

On Sunday evening, 29 November 2026, a pipeline run that had started at 7:49 p.m. America/Toronto finished its code generation at 8:18:47 p.m. The generation manifest is timestamped 30 November 2026, 01:18:47, which I am reading as UTC because the live-ranking file written thirty-six seconds later is explicitly marked UTC. In America/Toronto that is 8:18 p.m. on the 29th. Five C++20 bots had been requested. Five compiled, each on the first attempt, each marked paper-only, each attributed to the same model tag. Two seconds later a three-bot Python export was written. Thirty-four seconds after that, a live ranking of twenty-five copper bots on the December 2026 COMEX contract, HGZ6, was sitting on disk.

That is the good news, and it is real news. A generation step that emits five compiling C++ executables is a working toolchain. The rest of the evening is the part a risk committee would actually read.

All five of those compiled bots were then replayed on front-month (or nearby) four-hour bars. All five lost money. The copper AI-demand bot finished at −39.934 points over 78 trades with a 1.28 percent win rate. The copper semiconductor bot finished at −5.613 points over 48 trades. The clean-energy bot, pointed at micro copper, finished at −1.67 points over 48 trades. The EUR/USD ECB–Fed bot finished at −8.46835 points over 84 trades and did not win a single one of them. The second euro bot finished at −0.0668 points over 62 trades. Four of the five were flat on the last bar. One, the ECB–Fed bot, was still short.

Meanwhile the library that this evening run inherited — a 100-row “profitable bots” backtest file timestamped 3:15:25 p.m. on the same day, with no timezone of its own, which I am reading as America/Toronto wall time — still grades the same names B+ and A+. Seventy-three copper rows share one 15-month return path with a Sharpe of 1.008. Twenty-six euro rows share one three-month path with a Sharpe of 3.174. One micro-copper row has a shorter, 0.984-correlated cousin of the copper path and a Sharpe of 0.689. The HTML report that accompanies the file is titled “Profitable bots backtest (SMA 10/20 approximation).” The option-flavoured names in that file were not tested as options. There were no PDFs and no CSVs in the run folder. The numbers in this article come from the backtest HTML and JSON, the generation and Python-export manifests, the five per-bot backtest_result.json files, and the live-ranking JSON and markdown.

This is a paid research note, and it does three things.

  • It treats Sunday night as a second exam. The library grade is the first sitting. The compiled-bot replay on HGZ6, MHGF7 and 6EZ6, plus the 25-bot live ranking on 1,200 five-minute bars of HGZ6, is the second sitting. I walk through what each file actually contains, where the files disagree with each other, and which statistics can and cannot support a size. Bot trading rules and parameters are trade secrets and are not described, quoted or enumerated anywhere in this post.

  • It turns the theme that actually dominates the library — a long-copper demand thesis, dressed in AI, data-centre, semiconductor, China-stimulus and clean-energy labels — into an institutional structure that respects the left tail. The core I argue for is a defined-risk COMEX copper bull call spread. A tightly budgeted euro bear-put overlay is optional, and is not sized off the 3.17 Sharpe. I do not treat the seventy-three copper names as a diversified book, and I do not treat a 0 percent win rate on 84 compiled-bot trades as a rounding error.

  • It gives you the tools: the quantitative formulas as plain pseudocode you can port to any language, Python that I actually ran on this file, and a set of tested low-latency C++ building blocks. The C++ was compiled and timed with g++ 14.2.0 at -O2 -std=c++20 on a Linux box. Windows and Microsoft Visual Studio were not tested here.

The 100-row backtest file by contract code. 71 rows are generic HG, two are the already-expired June 2026 copper contract HGN6, one is micro copper (MHG), and 26 are euro FX (6E).
User's avatar

Continue reading this post for free, courtesy of The Order Book Edge.

Or purchase a paid subscription.
© 2026 QuantLabs.net · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for writing, podcasting, and media founders.