Skip to main content

Quantitative Backtesting and Validation Framework

Overview

  • Research-oriented backtesting and validation for the development and evaluation of portfolios and systematic trading strategies
  • Currently focused on U.S.-based equities and derivatives (primarily SPY-related assets)

Supported Asset Classes

  • Stocks/ETFs

Supported Time Horizons

  • Medium frequency (daily/hourly)
  • Low frequency (1mo/3mo)

Supported Strategy Classes

  • Time-series strategies
    • Mean reversion
    • Cointegration (statistical arbitrage)
    • Momentum/ trend following
  • Cross-sectional strategies
    • Mean reversion
    • Momentum/ trend following

Methodology

  • Walk-forward testing (train/validation/test periods)
  • Functional framework for modular experimentation
  • Implements regime classification
  • Utilizes common portfolio constraints
  • Vectorized operations (Pandas/NumPy)
  • Multiprocessing (joblib)
  • Bayesian optimization (optuna)
  • Risk-adjusted performance metrics used for assessment
  • Supports graphs for visualization along with HTML export (Plotly)
  • Uses packages (scikit-learn, PyTorch) to allow applying learning methods to all parts of the testing pipeline
  • Execution costs, slippage, turnover costs included.

Quickstart

Create the virtual environment

python -m venv .venv

Activate the virtual environment

Windows (PowerShell)

.venv\Scripts\Activate.ps1

macOS / Linux (bash)

source .venv/bin/activate

Install necessary modules

python -m pip install -e

Entry point to execute backtester

python -m run

Results

  • Regime based strategy implementation of mean reversion, momentum trending, cross asset mean reversion, cross asset momentum trending
  • Multi asset cointegration
  • Learning based regime models
  • Learning based parameter optimization

Results emphasize out-of-sample performance and regime stability rather than raw metrics optimization.

Future goals

  • Implementation of a broader range of factor models
  • More explicit Bayesian filtering with a detailed implementation of the Kalman filter and path dependent models
  • Greater focus on volatility including the implementation of volatility targeting and classification of asset volatility

Repository Structure

  • src : Core strategy logic
  • docs : Successful portfolios' trading logs, equity curves, and related analysis tools
    • results: Human-readable results.
  • tests: Example of package usage and tests of strategies.
  • data: cache data storage
  • artifacts: cache results storage

For a comprehensive discussion of strategy logic and methodology, see https://qgspinor.com/projects/alp_gen

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quant_backtester-0.3.5.tar.gz (31.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quant_backtester-0.3.5-py3-none-any.whl (35.4 kB view details)

Uploaded Python 3

File details

Details for the file quant_backtester-0.3.5.tar.gz.

File metadata

  • Download URL: quant_backtester-0.3.5.tar.gz
  • Upload date:
  • Size: 31.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for quant_backtester-0.3.5.tar.gz
Algorithm Hash digest
SHA256 4e1f833ddeb66d3491870836be133ca8b06bf3d0aa5bb47cf446d310c155f563
MD5 95deb9640e9b2a3f24d0cd3d9571ddad
BLAKE2b-256 53d71fd3db100574ad4b2d4c6ef89440f34b3e8a5404e289849bb0e052d36dd1

See more details on using hashes here.

Provenance

The following attestation bundles were made for quant_backtester-0.3.5.tar.gz:

Publisher: publish.yml on sponge-mi-boi/Quant-data

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quant_backtester-0.3.5-py3-none-any.whl.

File metadata

File hashes

Hashes for quant_backtester-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f06c3ca85a9a2e16b37cfb1b1fa9d86788753b7a839b0390ae21fa817a72e10a
MD5 b39ca25380da44b3fa5efa01f67249bc
BLAKE2b-256 489f3e2269d09a6ab31bebe0d624ad2af1f24479446994e8d470322f06d60553

See more details on using hashes here.

Provenance

The following attestation bundles were made for quant_backtester-0.3.5-py3-none-any.whl:

Publisher: publish.yml on sponge-mi-boi/Quant-data

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.5 This release

2 files

0.3.4

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page