Highlights

Three developments matter most: position management and learning are now base-class machinery in the shared algo library, the numbers are exact, and the system is learning when not to trade.

Position management & learning as base classes
The shared algo library now ships a common machinery layer: the algoBase_c skeleton turns an entry module's intent into a protected, pyramided, journaled position — and the learning layer rides in the base, advisory and clamped by a fail-closed risk kernel. Strategies write the entry module and inherit the machinery.
Profit accounting is exact
A long-standing bug double-booked realized P&L and inflated the account curve — at one point a single fill appeared to add 18 units. The curve now reconciles exactly, and per-trade accounting is consistent.
Learning when not to trade
A new decision layer learns whether to stand down, reduce, or serve from the market regime rather than fixed thresholds. It is observing in shadow before it is allowed to act — directly addressing the failure mode where a range-trading strategy loses through a strong trend.

Protocol & Dashboard

The engine-dashboard contract is now versioned, negotiated, and self-describing.

Versioned protocol (v4)

The dashboard now speaks a versioned protocol with feature negotiation on connect, so the engine and UI agree on capabilities instead of guessing. An older client keeps working unchanged — the new surface is additive and negotiated per connection.

Live module inventory

The dashboard's About page lists every loaded module with version, build number, git revision and type — 52 modules across the exe, subsystem, algos, exchanges and indicators. One glance answers "which build is this run?"

Self-describing builds

Every module is stamped automatically at compile time with its version, commit and a dirty flag, so a run can no longer be mistaken for a different one. A build that doesn't match its commit is flagged rather than silently trusted.

A home for the wire contract

The wire protocol now has its own repository and a print-quality PDF manual, so the contract between engine and dashboard has one authoritative home — linked from the Downloads page and summarised on the Protocol page.

Why v4 exists
The failures that motivated v4 were semantics problems, not encoding problems: push-only delivery with no authoritative live set, no defined meaning for a rejected operation, and identity carried as JSON numbers. v4 fixes those with request/response, authoritative snapshots, explicit revisions, and string identity.

Trading Engine Correctness

Correctness fixes that make the engine's view of orders, fills and P&L match what really happened at the venue.

Profit accounting fixed

Realized P&L was double-booked, inflating the account curve. The curve is now exact and per-trade accounting reconciles.

Order state revisions are observable

A rejected modify could leave an order showing as active on the dashboard while the venue had refused it. Cancels, fills, rejections and expiries now each carry a revision, so the UI can never show a stale state.

Phantom orders eliminated

Orders lost to a dropped connection now reconcile correctly instead of accumulating as ghosts that never terminate.

Cancel sweeps are race-safe

A flatten could attempt to cancel an order the engine had already retired. The guard now drops the stale handle cleanly, and the underlying invariant remains asserted rather than worked around.

Real Cost Awareness

The algos now know what a round trip costs

Trading costs are derived from each venue's published fees and the live spread instead of a hand-set placeholder that was zero — so quoted edge is measured net, not gross.

Learning Stack — the platform now learns

The learning layers are shared infrastructure, not per-strategy copies — the same stack now powers the range-bound strategy and the trend-pullback algoTIDE. From every closed trade the system extracts evidence, tunes its own gates and exits, and measures before it serves.

Adaptive learning & self-tuning

algoValueFeedback_c self-tunes entry gates from realized edge, with trustedKEdge() / maturityVerdict() telling a warm learner from a cold one. algoExitShape_c learns a bounded stop/hold pair, algoExitCounterfactual_c replays closed trades to find the best exit, and algoParticipationGate_c learns whether to stand down, reduce, or serve.

Causal regime intelligence

algoRegimeFeatures_c is a strictly causal 10-feature context vector — a forward-looking feature is structurally unrepresentable. The algoRegimePosterior_c is a shadow gate that can only stand an algo down; no configuration can let it force a trade.

Offline training & promotion

algoOfflineTrainer_c + algoWeightBundle_c deliver deterministic time-series CV, Platt + Mondrian-conformal calibration, and byte-identical versioned bundles. algoPromotionPolicy_c is the one evidence gate for every layer: PROMOTE / HOLD / DEMOTE over N realized labels.

Shadow-first and promotion-gated by design
Most layers measure before they serve, and algoRealizedPnlTrust_c stops a mis-scaled venue P&L from poisoning learning — its WITHHOLDING verdict is distinct from COLD. Per-contract, append-only state with algoContractFingerprint and layoutHash() means a state file can never silently apply another contract's learning. See the full learning & feedback loop →

Shared Algo Library: Base Machinery + ML & NN Capabilities

Our shared ttAlgoStatic library now ships two new layers: a common base machinery — position management and learning as base classes every strategy inherits — plus comprehensive machine learning and neural network components available to every strategy. Key capabilities include:

Base Machinery — position management in the base class

The algoBase_c skeleton owns how a proposal becomes a position: position state machine, protective stop/TP geometry via algoProtectionPolicy_c, pyramiding with admission learning, algoPositionManager_c risk-based sizing with per-asset balance isolation, and session guard with daily-loss latches. Fixed, fail-closed kernel between every proposal and execution.

Base Machinery — learning in the base class

The learning layer rides in the skeleton: algoValueFeedback_c nudges entry gates from realized edge, algoBasePyramidFeedback_c learns pyramid admission, and every action and refusal lands in the decision journal. Advisory by default, clamped by the fixed-vs-learnable envelope — the learner can veto, never force, an action.

Online Learning Models

Online logistic regression with drift-freeze monitoring, bagged ensembles for uncertainty estimation, and contextual LinUCB bandits for shadow policies.

Regime Detection

Hidden Markov Models (up to 4 states, 8 dimensions), Bayesian change-point detection, and conformal abstention gates for evidence-based trading decisions.

Statistical Primitives

EWMA accumulators, Welford variance, percentile rings, z-scores, crossover detection, and hysteresis gates — all with fixed-capacity allocation and zero heap traffic in update paths.

Deterministic Design Contracts
- decimal_t end-to-end for all financial calculations.
- No heap allocation in update paths. State is either fixed-capacity (std::array, constexpr arrays) or allocated once via st_malloc in configure().
- No locks. All classes are pure state machines designed for the algo's strand.
- Deterministic offline training. Index-arithmetic splits, fixed fold order, splitmix64-seeded model init, fixed iteration count. Same corpus + config → byte-identical bundle.

Venue Coverage

Lighter integration hardened

Fee and latency tiers, the colocation target and API-key semantics are documented — the groundwork for a live deployment. See the Exchanges page for the full venue matrix.

Operational

Stale-plugin detection

The engine refuses a plugin set that doesn't match the running build, and the dashboard surfaces a mismatch as a deployment fault instead of misbehaving quietly.

Live order-latency measurement

A new algoLatencyProbe harness places far-from-market limit orders (never fillable) and records submit/create-ack and cancel/cancel-ack round-trips into a JSON latency profile — consumed by the simulated execution model, so playback timing reflects the venue you measured.

Read the protocol for yourself
The authoritative v4 wire contract is available as a print-quality PDF on the Downloads page. A summary of the handshake, streams and schemas is on the Protocol page.