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 logicdocs: Successful portfolios' trading logs, equity curves, and related analysis toolsresults: Human-readable results.
tests: Example of package usage and tests of strategies.data: cache data storageartifacts: 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee2431f0997a4f05f7adcf4954395658801a1faab13d5157dadfd38e1fc9523f
|
|
| MD5 |
29fc382b8641147536d6d1be50bccaf4
|
|
| BLAKE2b-256 |
1c8f5afd69c612e931fdf77806a60d665d46d1cecab0fd6d27f9d1223f240838
|
Provenance
The following attestation bundles were made for quant_backtester-0.3.4.tar.gz:
Publisher:
publish.yml on sponge-mi-boi/Quant-data
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quant_backtester-0.3.4.tar.gz -
Subject digest:
ee2431f0997a4f05f7adcf4954395658801a1faab13d5157dadfd38e1fc9523f - Sigstore transparency entry: 2627035500
- Sigstore integration time:
-
Permalink:
sponge-mi-boi/Quant-data@13c25f841fbbe426f769e914115aef57cca07db6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sponge-mi-boi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@13c25f841fbbe426f769e914115aef57cca07db6 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file quant_backtester-0.3.4-py3-none-any.whl.
File metadata
- Download URL: quant_backtester-0.3.4-py3-none-any.whl
- Upload date:
- Size: 35.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a81b649f2ca39e0bb01b119f030d65a7cad0a8cfe68e2dfa2761144573e98dbe
|
|
| MD5 |
24a5884634bf601b305da41989044612
|
|
| BLAKE2b-256 |
55d3fe48c785cf700cd596a61f4445cd90c797dabda49d0e8011eb48a663ff8d
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quant_backtester-0.3.4-py3-none-any.whl -
Subject digest:
a81b649f2ca39e0bb01b119f030d65a7cad0a8cfe68e2dfa2761144573e98dbe - Sigstore transparency entry: 2627035503
- Sigstore integration time:
-
Permalink:
sponge-mi-boi/Quant-data@13c25f841fbbe426f769e914115aef57cca07db6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sponge-mi-boi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@13c25f841fbbe426f769e914115aef57cca07db6 -
Trigger Event:
workflow_dispatch
-
Statement type: