Repository navigation
Releases
2.6.3 — screen --workers actually parallelizes
screen --workers actually parallelizes
A patch release: one flag that did nothing now works, plus two fixes on the code path it now uses.
Fixed
screen --workers Nnow evaluates points in parallel.- Before, the flag was accepted and documented, but every screen still ran in one process.
- It now follows the same rule as
optimizeandwalkforward: it warms the bar cache once before handing out work, and reads--cache-dirand--offline. - The report is the same with one worker or several.
- MCP worker tools read the server's own bar cache.
- Under
quantred mcp --offline, every candidate dispatched byrun_screen,run_optimizationorrun_walk_forwardfailed asking for API keys. - Under
--cache-dir, those workers read the default cache instead.
- Under
- An offline parallel run no longer logs a pre-warm failure and traceback on a machine with no API keys.
Results from completed runs are unchanged, so ACCOUNTING_VERSION stays at 8.
pip install -U quantred. Full notes: changelog.
2.6.2 — an interrupted parallel search names no winner
An interrupted parallel search names no winner
A patch release with one correctness fix.
Fixed
-
Ctrl-C during a
--workerssearch no longer names a winner. Interrupting a parallel optimization, screen, or walk-forward in-sample search cancelled the pending candidates but then:- ranked the candidates that had finished;
- printed a "best" chosen from part of the search;
- journaled those candidates as trials of a search that never completed;
- exited 0.
A Bayesian search also carried on into its next round.
-
Now the parallel path stops the same way the sequential one always has. The command exits non-zero with
Interrupted - no winner named, no config saved, no trial recorded., and any finished candidates are discarded.
Results from completed runs are unchanged, so ACCOUNTING_VERSION stays at 8.
pip install -U quantred. Full notes: changelog.
2.6.1 — aligned stress tables, a lone fold length refused, techniques named not authors
Three fixes found by reading the output as a first-time user would
Fixed
backtest --cost-stresscolumns no longer run together.- Before, the return and cost columns printed as
10.69%$ 906. - Both stress tables (
--cost-stressand--fill-stress) now share one renderer, and each column widens to fit its widest cell.
- Before, the return and cost columns printed as
walkforward --train-daysor--test-daysalone is now refused.- The two only define the fold sizes as a pair. Given just one, the typed value was silently discarded.
- Now the CLI and the service both refuse it before reading any data.
- Help and docs name techniques, not their authors.
- Help text, printed output, MCP descriptions and the usage docs now describe the Bayesian posterior blend, covariance shrinkage, the family-wise bootstrap test and the automatic block length by what they do.
- Identifiers, including the recorded
blposterior value, are unchanged.
pip install -U quantred. Full notes: changelog.
2.6.0 — accounting v8, and docs for the reader who installs from PyPI
Accounting v8, and docs for the reader who installs from PyPI
Accounting v8. This release sets ACCOUNTING_VERSION to 8, so earlier trials leave the default trials list, and that command says how many were hidden.
- An entry larger than the free pool is capped to it, on both clocks.
- The backtest used to refuse such an entry outright.
- Live used to check it against the venue's buying power and send a position larger than the whole pool.
- Other parity, sizing and search fixes. The changelog has the full list.
Documentation
- Installation leads with PyPI. It covers
uv tool, pipx and pip in a venv, extras,quantred init --check, where state lives, upgrading without dropping extras or packs, and uninstalling. - Every usage page now covers:
- a minimal invocation;
- how to read the result, including refusals and failed gates;
- common errors;
- what to do next.
- First-run gains a troubleshooting table.
- Flag tables match the commands. Sample output is current and labelled illustrative.
- Live trading opens with a checklist for a first paper session.
- The MCP page lists all 33 tools.
- The engineering wiki describes the code as it is.
QUANTRED_HOME. This is the first release to ship the QUANTRED_HOME / ~/.quantred state root. The old names are still read.
pip install -U quantred. Full notes: changelog.
2.5.0 — accounting v7: the engine's numbers, proved and pinned
Accounting v7: the engine's numbers, checked against independent calculations and pinned
A numeric review of the engine found defects that put wrong numbers in front of users and into promotion gates. This release fixes them and bumps ACCOUNTING_VERSION to 7, so earlier trials leave the default trials list (it says how many); trials archive retires the era.
Engine
- Benchmark-relative metrics were wrong. Benchmark returns were paired with the next bar's strategy return, so alpha, beta, R², IR, Treynor and the benchmark-relative promotion prerequisite were off. A book holding its own benchmark read beta ≈ 0; it now reads ≈ 1.
- Stops and targets that gap through fill at the open. When the open is beyond a level, the open decides which level filled.
- A look-ahead is gone. A stop or target hit inside a bar no longer frees cash or a slot for an entry at that bar's open.
- Cost stress means what it says. The configured spread is now applied, and the stress scales it: "3×" is 3×, where it was about 1.6×. Liquidity in cost estimates is trailing-only.
- Walk-forward aggregate is on trading days, with the deflated-Sharpe inputs in one unit.
Live trading (paper by default)
- Entries size like the backtest: against capital, or account equity when no capital is set (never margin buying power), minus what the book holds. Sizing moves with realized P&L.
- A fully invested book declines new entries.
- See the changelog for the remaining differences between live and the backtest.
Risk, portfolio and analytics
- Factor model: gains an intercept factor, so a common market move is no longer counted as specific risk.
- Sortino: uses the standard semideviation.
- Transfer coefficient: now risk-weighted, so TC × IR* is the predicted IR.
- Horizon blend weights: now maximise IC.
- Breadth: deflates by residual correlation and reports unavailable on thin data, never 0.
- Constant series: reports unavailable, where it used to report a ~1e16 Sharpe.
- Labels: Monte Carlo is a real annualised Sharpe distribution. "PBO" is relabelled a heuristic, and the bootstrap statistic is labelled a Sharpe.
Why you can trust the numbers above. A new math contract, tests/math/, checks every formula against a calculation written independently of the package. It also pins the end-to-end outputs of 19 seeded scenarios. Every fix was deliberately re-broken to show the suite catches it.
pip install -U quantred. Full notes: changelog.
2.4.1 — docs at quantred.mk-dir.com, QuantRed container names, a false warning gone
A patch on top of 2.4.0.
- No false "a pack imports the old
tradeflowname" line. MCP client configs written before the rename launch throughpython -m tradeflow.cli(viatradeflow-engine2.3.1). That launch imports the old name itself, and the check blamed a pack for it on every start. It now warns only when the old name first appears while packs load. - Docs are at quantred.mk-dir.com. Package metadata, README links and the hints the CLI prints point there. Links to tradeflow.mk-dir.com redirect, path and query intact.
- Docker: containers are
quantred-mcpandquantred-docs. Update anydocker exec,docker logsor client config that names the old ones. Volumes keep their names: the compose project is pinned totradeflow, so existing state attaches, even from a fresh clone in aquantred/directory.
pip install -U quantred. Full notes: changelog.
2.4.0 — TradeFlow is now QuantRed
TradeFlow is now QuantRed
pip install quantred / uv tool install quantred. The distribution, the command and the import package are all quantred; plugin entry-point groups are quantred.strategies and quantred.scanners (the old tradeflow.* groups are still read). ~/.tradeflow and TRADEFLOW_HOME are unchanged, so recorded history carries over.
Already on tradeflow-engine? pip install -U tradeflow-engine moves you across: its final release, 2.3.1, is a transition package that installs quantred, keeps the tradeflow command, and keeps import tradeflow working (same objects as quantred.*, with a DeprecationWarning). Under uv tool an upgrade gives you tradeflow but not quantred; reinstall as quantred when you're ready. A private pack needs from tradeflow → from quantred and its dependency changed. Steps: migrating to QuantRed.
Accounting v6 — earlier trials leave the default listing
Window boundaries computed by adding days to a market date kept January's UTC offset, so from March to November they sat an hour late and every summer out-of-sample fold began a bar late. Consecutive out-of-sample folds also shared their boundary bar, and a walk-forward's in-sample search chose parameters at the default one-position book while its folds scored the configured book. ACCOUNTING_VERSION is 6, so all earlier trials drop out of the default trials list (it says how many); trials archive retires the era.
Also in this release
- A first session that works from install. Readiness per task (
init --check --for …), install hints that keep your extras and packs, model-provider setup ininit, and refusals that say what to type instead of a traceback. - MCP works in a real client. Starts without broker keys (
mcp --offlinefor cache-only), every result is strict JSON, bad input is a tool error, andsave_config/load_configstay inside the configs directory. - One identity across CLI and MCP. One request is one trial whichever surface ran it; capital, benchmark and book are part of a run's identity, so a $4,000 request is never answered from a $100,000 run.
- Honest labels. In-sample kinds stay off leaderboards, every Sharpe carries its basis, reused results say what they lack, and absent values say so instead of printing 0.
- Fixes:
trials promotedropped the cost model; Calmar, Sterling, VaR and CVaR reported a loss as a gain; Docker images carried.env,specs/andlogs/from a checkout. - Research agent: generated-code configs are refused at load, malformed model replies become recorded rejections, and selection is on net returns by default.
Full list: changelog.
2.3.0 — research affordances, and two telemetry modes kept apart
The same look-ahead again, one layer down
The book was marked to a bar's close before entries were considered, and the exposure caps are tested against equity × cap — so whether an entry filling at that bar's open was admitted could depend on where the bar finished, hours later. Same class as the v4 signal defect, in the admission gate rather than the signal, and just as invisible to a feed shift. Found by the new causality probes rather than by a user, which is the point of building them. ACCOUNTING_VERSION is 5.
The promotion gates are deliberately not recalibrated: this moves no metric systematically, and rescaling a threshold with no measured shift behind it is gate-fitting.
Two telemetry modes, kept apart on purpose
Observing what execution actually does used to require shrinking a book's caps by hand until fills happened — which biases the sample toward low-priced names and means the strategy under observation is not the strategy that was validated. That is now two separate answers to two separate questions.
live --dry-run drives the real decision path against a stated capital with a broker that cannot trade. Its vocabulary is deliberate — would_submit, would_bind, would_skip, never submitted or filled — because a report that borrows execution's words gets read as execution's evidence. It journals nothing: a rehearsal must not spend a family's statistical budget.
small-real trades the validated contract at reduced capital rather than reduced caps. Fractions scale because capital did, counts stay counts, dollar ceilings scale, and venue floors stay absolute — a broker's minimum does not get smaller because a run chose to. That cost is measured rather than hidden: refusals carry reason codes so the bias is a number in the report. Shrink far enough and it stops being a bias and becomes the whole result, so a scale at which no order could clear the floor is refused outright.
Also added
Trial analytics and comparison, portfolio excursion, campaign materialisation and export, a widened MCP construction surface with evidence-gated families still excluded, and reconcile / flatten learning --ledger and --small-real.
Fixed
A saved config that traded a book it was never validated at · min_notional enforced in the backtest and absent from the live path · flatten reporting a submitted close as a closed position · a flatten leaving the ledger permanently unreconcilable · a session header claiming a run happened when it never began · MCP silently discarding unknown arguments · halted refusals fragmenting by timestamp · configs crashing instead of refusing.
Durable records
LEDGER_VERSION is 4, adding session_outcome and flattened. Older files simply lack them, and that reads as exactly what it is — a book flattened before the event existed still reconciles as missing, because inferring a flatten from a divergence would excuse the dropped fill the divergence exists to surface.
Most of what is fixed here was found by running the software rather than reading it, and several of the fixes came out of an evidence check that never completed.
Full notes: changelog.
Full Changelog: v2.2.0...v2.3.0
2.2.0 — what running it against a real account found
Live-path validation against a real paper account, and the defect it eventually found. Everything here came from running the thing — the preflight, the ledger, the execution report and finally a trade table each surfaced something the full test suite agreed was fine.
Tagged and published late. The version and its changelog entry were written on 2026-09-02 and the tag was never pushed, so this release sat in the repository for two weeks without reaching the package index. It is tagged at the commit that set the version, so what is published is what its changelog entry describes — not the month of work that followed, which ships as 2.3.0.
Full notes: changelog.
2.1.0 — Hardening the trade clock
Hardening the trade clock — the smallest and least-tested part of this project,
which is backwards, since it is the only part that can lose money.
Most of what follows was found by running the live path rather than reading it.
Two were live bugs that looked correct in the source and passed every test.
Fixed
The live path could open a position but never close one. A strategy decides
whether an exit is legitimate by looking itself up in its own position book, and
nothing in live mode ever wrote that book — so every CLOSE_BUY/CLOSE_SELL was
rewritten to HOLD before execution saw it. A live position could only be closed by
its broker-side bracket legs, if it had any. The unit tests passed throughout,
because they feed handle_signal directly and so exercise the layer below the break.
A strategy could go permanently silent with nothing logged. Warm-up history is
timezone-aware and a feed may stream naive timestamps; mixing them made every later
comparison raise inside process_bar, whose blanket except turned that into a
strategy that emitted nothing at all, indefinitely.
Warm-up fetched a fraction of the history it asked for. The lookback converted
bars to wall-clock time directly, which counts the overnight gap, the weekend and
every holiday as tradeable: fifty one-minute bars became "100 minutes ago", so a
09:35 start warmed a fifty-bar indicator with five bars and ran anyway. The window is
now measured in sessions, and a short warm-up is reported rather than absorbed.
Missed signal edges were lost for good. Entries fire on the crossing bar and
never again, so a rejected bar, a dropped stream or a restart left the score saying
"should be long" while every bar emitted HOLD.
Added
A kill switch. tradeflow halt | resume | halts records a durable decision to
stop; tradeflow flatten --confirm halts, cancels every order and closes every
position, going straight to the broker so it works when the engine is wedged. Halt
state is a file, not a database — the order path holds no connection to anything that
can be down. Halts block entries and never exits, so the switch cannot trap the book
and flatten cannot deadlock against its own gate.
Deterministic client order ids. The guard against double-submitting was a
question asked of the broker immediately before placing an order — a check-then-act
race with no memory across a restart. Each order now carries an id derived from the
decision behind it, so a venue that has already accepted it rejects the duplicate.
Typed broker failures. Every broker call used to fail as None or False, so a
rate limit, an expired token, insufficient funds and a deliberate rejection all
produced the same non-answer. Two cases were actively wrong: a duplicate order read
as a failed submission, and list_positions returning [] — the claim that the
account is flat — when the broker could not be reached.
A decision record for every signal. "No order" had a dozen causes and one
representation. Execution now returns what it decided, why, and which guards it
consulted — the guards that ran, not just the one that fired.
Changed — read before upgrading
- A strategy started while the score already implies a position takes it on the
first live bar, rather than waiting for the next crossing, with stops from the
current price. Default on;--no-reaffirm-entriesopts out. - An unreadable market clock no longer uniformly means "assume open." That is
right for a transient blip but was also applied to revoked credentials, which are
never transient. Authentication failures now fail closed. - Position-book hydration is not governed by
--reconcile-every. A broker read
happens at start-up even with reconciliation disabled. - Internal trade-clock interfaces changed shape.
Broker.submit_*take a
client_order_id; the order-path methods raiseBrokerErrorrather than returning
None/False;LiveTrader.handle_signalreturns aDecision. No supported API
moved —tradeflow.services.*is the supported surface and is untouched — which is
why this is a minor. Anyone who reached past it into the broker or execution layer
will need these.
Verified
881 tests (up from 817), ruff clean, links clean across 98 files, the docs site
compiles, and the wheel installs into a clean venv and reports 2.1.0 with every new
verb resolving from that installed copy. The halt/resume/flatten CLI was driven end
to end. Both follow-up regressions were confirmed to fail with the fix backed out,
rather than assumed to cover it.
No live paper smoke test: every change here is on the order path, and the suite
drives the real LiveEngine and LiveTrader against faked edges only.
Full changelog: https://tradeflow.mk-dir.com/changelog