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 src.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.4.tar.gz (31.7 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.4-py3-none-any.whl (35.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: quant_backtester-0.3.4.tar.gz
  • Upload date:
  • Size: 31.7 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.4.tar.gz
Algorithm Hash digest
SHA256 ee2431f0997a4f05f7adcf4954395658801a1faab13d5157dadfd38e1fc9523f
MD5 29fc382b8641147536d6d1be50bccaf4
BLAKE2b-256 1c8f5afd69c612e931fdf77806a60d665d46d1cecab0fd6d27f9d1223f240838

See more details on using hashes here.

Provenance

The following attestation bundles were made for quant_backtester-0.3.4.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.4-py3-none-any.whl.

File metadata

File hashes

Hashes for quant_backtester-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a81b649f2ca39e0bb01b119f030d65a7cad0a8cfe68e2dfa2761144573e98dbe
MD5 24a5884634bf601b305da41989044612
BLAKE2b-256 55d3fe48c785cf700cd596a61f4445cd90c797dabda49d0e8011eb48a663ff8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for quant_backtester-0.3.4-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

0.3.5

2 files

This release

0.3.4 This release

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