Skip to content
← Selected projects

Trading engine

2026 · open source · paper only

v8 · 2 Oct 2026 · One shared backtest core

Since v7, the engine has changed shape. Every strategy is now a short specification that runs through one shared backtest core and one evidence path before a paper portfolio can observe it. The AI comparison is live, operations are less fragile, and the data layer now shows how much history the old store missed. It is still paper only. No policy has beaten its frozen control yet.

Figure 01 · One evidence path · v8

Every strategy goes through the same core

A short strategy specification enters one evaluator; the evaluator owns the data boundary, simulation and proof before a paper portfolio can observe the result.

  • Strategy
  • Backtest
  • Evidence
  • Paper path

STRATEGIESSPECIFICATIONSHARED COREEVIDENCEPAPERpublic strategyopen specprivate strategyseparate repoFREEZEstrategy spectwo modesRUNSHARED BACKTEST COREnative simulationevents + portfoliosno peekingnamed costsgross bench.calendar DSRsealed holdoutREPORTreportevidencePAPERpaper bookpaper only
fig. 1 — v8. Public and separately held private strategies become short specifications. One core owns the no-peeking view, named costs, event or portfolio simulation, gross benchmark, calendar-day deflated Sharpe and sealed holdout. Only its evidence report reaches a paper portfolio. The private live-paper bridge is next, not active.

One core, then evidence

Before v8, a new strategy could bring its own replay machinery. Now it only describes its decisions, fills, exits, universe and liquidity rule. The shared core supplies data that refuses future rows, exact named costs, native event and portfolio simulation, the gross-benchmark rule, calendar-day deflated Sharpe and a sealed holdout that opens once.

I tested the evaluator on a synthetic market where the answer was known. It found the planted edge in 48 of 50 seeded runs and rejected noise in 7 of 200, or 3.5%. Serial and parallel reports were byte-identical. A shared in-memory price panel then cut the 16-worker, 3,000-stock benchmark from 989.05 seconds to 0.847 seconds without changing those bytes.

The AI comparison is live

Three matched paper portfolios now run on the same candidates and mechanics: one ranks with AI, one uses the fixed rule, and one starts with the rule and lets the model veto an entry. The first live cycles exposed bookkeeping and evidence problems. I fixed the checks around refreshed prices, completed fills and league reports without changing the scores or the comparison.

Less waiting, fewer hidden failures

Each nightly stage now records its own timing. Price checks overlap network waits, earnings refreshes are bounded between weekly full passes, and the weekly walk-forward uses a rolling eight-slot pool. Together the measured collection changes remove about 18 minutes from a 44.5-minute nightly path.

Completed writers also publish verified read-only database snapshots. If the live database is busy, read-only API routes can serve a recent snapshot and say when it was taken. Repeated intraday responses keep their receipt but no longer store unchanged bars again, cutting that repeated growth by about 95%. The league report is rendered before a failed evidence check stops the scoring report, so the current paper standings are not silently skipped.

A freer survivorship baseline

The free-source store now has a public ticker master with listing intervals, SEC delisting notices and public insider-trade datasets. Its audit found that the old store held only roughly a third of the listed names in each year from 2010 through 2025. A two-year whole-market daily-bar importer is ready, but it has not been run without the owner's free key, so older backtests remain explicit about their survivorship limit.

Private research strategies run in a separate private repo and are backtested on the shared core; a live paper book can observe one in real time without revealing it. That live bridge is the next step, not an active trading path.

status
paper only · no broker connection
paper portfolios
25 active in the simulator
matched AI comparison
AI-ranked · rule-ranked · rule with an AI veto
shared backtest
event and portfolio strategies · one deterministic core
evidence rules
no peeking · named costs · gross benchmark · calendar-day deflated Sharpe
holdout
sealed · one opening
synthetic proof
planted edge found in 48/50 seeds · noise flagged in 7/200 (3.5%)
full benchmark
3,000 stocks × 3,800 sessions · 16 workers · 989.05 s → 0.847 s
nightly
about 18 minutes removed from the measured 44.5-minute path
historical coverage
old store: roughly 30–38% of listed names per year, 2010–25
tests
4,217 collected

Paper trading only

The engine has no broker connection or authority over real money. I built it to get to a trustworthy yes or no, with every loss, unavailable input and failed check left in the record. The product docs carry the full data, research and operations detail.

Versions

The engine has changed shape several times since July. Figure 1 shows v8. Each earlier version has its own page with the diagram as it stood then.

  1. v1

    16–27 Jul 2026

    Data and the first paper portfolios

    Yahoo daily bars for about 12,200 listed names (Stooq was blocked on day one), a nightly trend screen, and ten paper portfolios filling at the next open.

  2. v2

    28 Jul – 3 Aug

    More portfolios and a backtest farm

    Six research-based strategies took the count to 16 paper portfolios, a farm replayed every portfolio over past years, and the rules for splits and dividends were settled.

  3. v3

    4–17 Aug

    AI adjusting the portfolios

    Five portfolios let a model veto entries or tune parameters inside fixed bounds, each paired with an untouched twin, and a news analyst wrote a morning brief. I retired all of it on 18 August.

  4. v4

    18 Aug – 17 Sep

    Evidence first

    Ten-fold walk-forward tests, audits of the fill model and the data sources, and frozen forward monitors that can only continue or kill a strategy. An audit on 2 September found seven simulator bugs.

  5. v5

    18–24 Sep

    An agent in the loop

    The repo went public. A nightly AI agent trades its own paper portfolio through a locked simulator tool, hourly agents watch without placing orders, a ledger scores every agent decision, and Alpaca is not connected yet while SEC EDGAR capture waits for access.

  6. v6

    25 Sep

    TradingView for research

    TradingView quotes and bars reached the intraday agents as research input. They never touched prices, fills or orders.

  7. v7

    26–29 Sep

    Scoring every candidate

    The model now scores every nightly candidate next to a fixed rule, three test portfolios trade those scores, and a paired test decides on fixed check dates. A challenger lab is built but switched off, and new strategy research moved to a private repo.

  8. v8

    2 Oct 2026 · current

    One shared backtest core

    Every strategy is now a short specification over one no-peeking evaluator, with native event and portfolio simulation, one evidence path and much faster full-market runs.

Ong Jun Xiong

SOFTWARE ENGINEER · SINGAPORE

ContactHobbiesArchiveNotesUI PackGitHubLinkedInSource

© 2026 Ong Jun Xiong