Skip to content
← Engine v1

An agent in the loop

1.5 · 18–24 Sep · An agent in the loop · see 1.8, the latest update

I let a model back in with 1.5, but only after writing a rulebook for the engine, and only with one narrow job: look at the day’s standouts and, at most, place one paper trade through a tool it cannot widen.

Figure 01 · 1.5 · 18–24 September 2026

An agent with one narrow job

The agent can place one paper trade through a locked tool; code decides its size and whether it passes.

  • Data
  • Decision
  • Next-open fill
  • Score

Yahoo 5-min + newsraw responses keptSEC · Alpacanot connectedYahoo + Nasdaqdaily · cross-checked1DUCKDB · ONE WRITERfactsas-of cutoffspricesrestated cachepaper ledgerfills · cashhourly + 4-hour agentsobserve onlydaily agent02:00 UTC · five standouts2SWING ONLYlocked toolone trade, sized by code3paper portfolios21 rule-based + 1 agentfillnext open onlyagent ledger1 · 5 · 10 · 20-day labels4forward monitorssector · 12-1 · Mondayswritten rulebooksize limitsSOURCESSTOREDECIDEPROVE
fig. 1 — 1.5. ① Yahoo's five-minute bars and headlines are kept as raw responses beside the daily prices; SEC and Alpaca adapters exist but stay off. ② At 02:00 UTC the daily agent reads point-in-time facts and assesses five standouts. ③ A swing needs one call to a locked tool; code sizes it, checks risk and places it in an isolated portfolio that fills at the next open. ④ Every decision, including the observe-only intraday agents', lands in a ledger that labels it against a control.

The contract came first

After my 6 out of 10 review on 18 September, with the server code at about 46,000 lines, the engine got a written rulebook: maintenance only, a bar that new work must clear, code-size limits that the tests enforce, and short build-log entries. The repo went public the same day.

One trade, through a locked tool

Each night at 02:00 UTC the agent looks at five liquid standouts and marks each one ignore, watch, hold or swing. A swing is only a request. It has to go through one locked submit_paper_trade call, and deterministic code decides whether it passes and how big it is: a risk-on market, a pass on the trend screen, confidence of at least 0.65, no earnings within five days, no more than three positions, and a 10% position size. The portfolio is isolated, holds US$10,000 of paper money and fills at the next open like every other portfolio.

The first run on 21 September produced five assessments, two watches and one swing, which was not traded. The hourly and four-hour agents have no order path at all.

Scoring without fooling myself

Every decision is stored with its information cutoff, the exact model and prompt, and labels at one, five, ten and twenty days, next to a paired control. A replay of 2022 showed why that matters: the model picked XOM on all four dates and compounded +19.78%. That says more about what a model already knows about 2022 than about its judgement, so the replay is labelled contaminated and cannot move anything to real money.

The direction written on 24 September is an engine that runs on its own and makes money, with AI in the decision loop, and it names evidence time, not code, as the constraint. Until the agent has 60 trading days, 90 calendar days and 20 trades behind it, I treat its results as a log, not as evidence.

dates
18–24 September 2026
rule portfolios
21, unchanged
agent portfolio
one isolated US$10k simulator portfolio · first run 21 September
agent buy rules
market in risk-on mode · passes the trend screen · confidence ≥ 0.65 · no earnings within 5 days · ≤ 3 positions · 10 % size
observers
hourly and four-hour agents · no order authority
ledger labels
1, 5, 10 and 20 days after each decision
first verdict
60 trading days, 90 calendar days and 20 trades before the nightly agent is judged
not connected yet
SEC EDGAR (probe refused) · Alpaca IEX (no credentials)
blocked
TradingView, under its terms at the time · Stooq

Ong Jun Xiong

SOFTWARE ENGINEER · SINGAPORE

ContactHobbiesArchiveNotesUI PackGitHubLinkedInSource

© 2026 Ong Jun Xiong