Skip to content

v9.0.0

Choose a tag to compare

@MDUYN MDUYN released this 17 Nov 13:24

Investing Algorithm Framework v9.0.0

v9.0.0 is the cumulative stable release of the complete v9 alpha series
(a1 through a22), including the subsequent release fixes—not just the changes
since the most recent alpha.

v9 unifies strategy research, vector analysis, event-driven validation, and live
execution around shared strategy, study, execution, and backtest models.

Study-first research and dual-engine backtesting

  • Reusable Study, Universe, and BacktestWindow definitions for in-sample
    research, time/universe out-of-sample validation, rolling and anchored windows,
    holdouts, time-series k-fold evaluation, and stress scenarios.
  • Vector and event results coexist in the same algorithm bundle, with
    engine-aware summaries, ranking, filtering, and reporting.
  • Combined multi-strategy event backtests can share a portfolio; independent
    algorithms can run as separate sweeps. Orders and trades retain strategy
    attribution, and event windows start with isolated portfolio/order/trade state.
  • Studies can be reused from saved results to event-validate selected winners
    and merge validation results without discarding earlier engines or windows.
  • Cross-sectional ranking, filtering, and scoring pipelines, Monte Carlo and
    permutation tests, evaluation-focus ranking, and benchmark comparisons.

Parameter optimization and resource-aware sweeps

  • Parameter optimization with optional baseline-first initial candidates,
    progressive window/final pruning, and checkpoint recovery.
  • Versioned terminal evaluation evidence for completed, pruned, and partially
    failed candidates, preserving window coverage and structured stop reasons.
  • Bounded, search-scoped reuse of prepared market data for providers that opt in,
    and early checkpoint selection to avoid unnecessary data preparation.
  • Configurable worker limits, worker-pool recycling, incremental persistence,
    and soft process-tree memory/system-headroom guards.
  • Durable scalar BacktestIndex results support selection without eagerly
    loading every full backtest.

Strategies, confluence, and explainability

  • Shared long/short signal sides, conflict resolution, sizing, risk, execution,
    and cooldown phases across supported execution paths.
  • Declarative confluence cards with state/crossover conditions, boolean
    composition, primary qualification, hard requirements, scored rules, vetoes,
    and thresholds.
  • Callable indicators and declarative indicator configuration through the
    recommended ConfluenceScoringStrategy.
  • Canonical DecisionTrace records explain emitted signals and no-signal
    decisions; legacy ScoreCard compatibility is retained.
  • Symbol/portfolio cooldowns, portfolio-wide exposure budgets, and default
    position-size/scaling rules with symbol-specific overrides.

Long/short execution and portfolio controls

  • SHORT/COVER routing, collateral reservation and settlement, partial-fill
    handling, FIFO/explicit trade allocation, and short-side P&L accounting.
  • Trades and SELL/COVER settlement follow actual fills, with fee reconciliation,
    cancellation/reservation release, and late-correction handling.
  • Fixed/trailing stop-loss and take-profit rules for both long and short trades.
  • Optional broker-native mirror stop-loss/take-profit safety orders for supported
    executors, with sibling cancellation and accounting only after observed fills.
  • Commission/slippage models, per-order/trade cost attribution, and reproducible
    execution assumptions stored with studies.
  • Explicit local/broker/automatic paper-trading modes and opt-in hedge positions.
  • Recurring/one-shot per-market deposits, environment credential resolution,
    and deployment overrides for credentials, paper mode, and initial balance.
  • Anchor-aligned scheduling shared by live and backtest execution, configurable
    startup execution, and local-timezone display without changing internal UTC.

Open Backtest Format, storage, and CLI

  • Portable .obtf bundles hold studies, universes, windows, engine results,
    summaries, metrics, orders, trades, positions, portfolio snapshots, execution
    assumptions, and robustness results.
  • Open Backtest Format support with compressed MessagePack metadata and
    Parquet-backed tabular data, legacy readers, and migration tooling.
  • Engine/window-preserving merge-on-save and strategy lineage metadata.
  • Read-only, disk-backed BacktestHistory sequences and lazy result loading.
  • Local-directory and tiered stores, SQLite scalar indexes, OHLCV deduplication,
    and CLI migration/index/list/rank/prune/store workflows.
  • Optional disk-backed event state and language-neutral decision records.
    Some loading, metric, and serialization operations still materialize data;
    these features do not impose a hard whole-process memory bound.

FastAPI, live controls, and run reports

  • FastAPI replaces Flask, with automatic Swagger documentation at /docs.
  • Algorithm status/start/stop/invoke/insights endpoints, persisted enabled state,
    trade endpoints, and portfolio order-cost overview/specification endpoints.
  • Manual invocation can wait for its correlated tick; a wait timeout does not
    cancel execution.
  • Persisted live/paper RunReport snapshots include portfolio state, positions,
    orders, trades, per-tick signal outcomes, and decision traces.
  • No-signal ticks and failed/skipped outcomes are explicit, and backtest run
    reports can be persisted separately for scoped diagnostic loading.
  • Configuration-only validation is available through
    App.validate(require_portfolio=False).

Metrics, dashboards, and correctness

  • Multi-study and per-engine HTML reporting and comparison dashboards with
    equity, drawdown, rolling ratios, monthly/yearly returns, activity, and
    symbol/scenario analysis.
  • Explicit independent-window aggregation, capital-weighted and median/best/worst
    returns, evaluated-window counts, completeness metadata, and mean durations.
  • Corrected downside deviation, Sortino/Calmar edge cases, worst-window drawdown,
    and raw-equity drawdowns beyond 100% after a positive high-water mark.
  • Corrected first-year/first-month returns and first-month cash-flow handling.
    A mid-month start produces a partial-month return.
  • Corrected multi-window provider refresh, event-window isolation, deterministic
    processing, checkpoint/merge behavior, and Windows report persistence.
  • Expanded strategy guides, cross-sectional examples, confluence examples,
    strategy showcases, and deterministic dashboard demonstrations.

Performance and optional native backends

  • Buffered history and bundle writes, bounded large-MessagePack handling,
    cached timeframe parsing, shared metric calculations, prepared-data reuse,
    and reduced archive/conversion overhead.
  • Optional Rust kernels for eligible confluence batches, vector NETTING runs,
    risk metrics, event fill selection, and timestamp traversal.
  • Explicitly selected native event-state/archive operations with protocol
    compatibility checks, platform wheels, and installed-wheel parity validation.
  • Python remains the default reference implementation. Installing native
    extensions does not change defaults. Native support does not promise a
    universal speedup, Python-free execution, or a hard process-memory limit.
  • Leaner core installation with optional cloud/notebook extras and
    cross-platform Python/native release checks.

Upgrading from v8

This is a major release with breaking API changes:

  • Use run_backtest / run_backtests with a Study, Universe, and
    BacktestWindow entries instead of the removed vector-specific entry points
    and legacy date-range keyword arguments.
  • Results are BacktestIndex objects; use iter_backtests() to load results.
  • Use generate_signals / generate_signal_series, or
    ConfluenceScoringStrategy, instead of legacy buy/sell hooks.
  • Move trading costs from strategies to PortfolioConfiguration or
    Study.execution_config; trading currency belongs to the portfolio/universe.
  • Replace legacy full-object backtest filters with scalar
    window_metrics_filter_function / final_metrics_filter_function callbacks.
  • Disk-backed history reads are detached and read-only; materialize, edit,
    and reassign when changing results. Writable temporary disk space is required.
  • Account for corrected metric semantics when comparing old results. Rerun old
    checkpoints for corrected accounting; affected live SQL ledgers need explicit
    reconciliation.
  • Migrate Flask integrations and removed /api/backtest-results/* endpoints to
    FastAPI and the current scoped portfolio/order/trade APIs.
  • Install optional extras for cloud deployment and notebook integrations.

Review the strategy guide,
backtesting guide,
and storage guide
before upgrading.

Installation

After publication to PyPI:

python -m pip install --upgrade investing-algorithm-framework==9.0.0

Python 3.10+ is required. The Python CI matrix covers 3.10 and 3.11 on Linux,
macOS, and Windows. Native wheels and installed parity have separate
cross-platform validation.

See the changelog
for the detailed prerelease history.