ConvexPi Lab — synthetic equity panel, backtester, and anti-overfitting grader
Project description
convexpi-lab
Synthetic equity panel generator, walk-forward backtester, and anti-overfitting grader for quantitative finance education and research.
pip install convexpi-lab
Part of the ConvexPi platform. See also convexpi-arena for the live exchange simulator.
Quick start
from convexpi.lab import SyntheticMarket, Backtest, LongShortRank
market = SyntheticMarket(n_stocks=50, n_days=756, seed=42)
result = Backtest(market).run(LongShortRank(feature='mom_1m'))
print(f"OOS Sharpe: {result.oos_sharpe:.3f}")
Graded submission
from convexpi.lab import Strategy, Grader
import numpy as np
class MyStrategy(Strategy):
def on_day(self, day, features, prices, portfolio):
sig = features['mom_1m']
total = np.abs(sig).sum()
return sig / total if total > 0 else np.zeros(len(prices))
report = Grader().grade(MyStrategy)
print(f"IS Sharpe: {report.is_sharpe:.3f} OOS Sharpe: {report.oos_sharpe:.3f}")
print(f"Overfitting ratio: {report.overfitting_ratio:.2%}")
Features
- Synthetic equity panel with planted alpha signals of known strength
- Walk-forward backtester with transaction costs and turnover limits
- Hidden-holdout grader — OOS data never seen during development
- Alpha discovery detection — did you find the planted signal or fit noise?
- 19 canonical strategy implementations (momentum, value, quality, size, risk-based)
- Real-data mode: Ken French factors, FRED macro, yfinance prices (optional)
- Anomaly graveyard: pre/post-publication Sharpe decay for 6 canonical factors
- Forward paper-trading scorer (nightly, via GitHub Actions)
Optional dependencies
pip install "convexpi-lab[real-data]" # yfinance + pandas-datareader
pip install "convexpi-lab[deploy]" # supabase + sentry (grader worker)
License
MIT © Shane Conway
Project details
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 convexpi_lab-0.1.0.tar.gz.
File metadata
- Download URL: convexpi_lab-0.1.0.tar.gz
- Upload date:
- Size: 54.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c798b7ec33fda9f52ecbca639614e76fea18194127adc5d6de64957a231541e
|
|
| MD5 |
f0b98d768903b039103b041eb7e7ab7b
|
|
| BLAKE2b-256 |
ea189dcc48f7d5c9d0bf0a8e68024a1f3cc1c014e6d8c499469ae032f19db26e
|
Provenance
The following attestation bundles were made for convexpi_lab-0.1.0.tar.gz:
Publisher:
publish.yml on convexpi/lab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
convexpi_lab-0.1.0.tar.gz -
Subject digest:
6c798b7ec33fda9f52ecbca639614e76fea18194127adc5d6de64957a231541e - Sigstore transparency entry: 1820424623
- Sigstore integration time:
-
Permalink:
convexpi/lab@75325a449273a65e51c6ca28e57f9b0154d13227 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/convexpi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@75325a449273a65e51c6ca28e57f9b0154d13227 -
Trigger Event:
push
-
Statement type:
File details
Details for the file convexpi_lab-0.1.0-py3-none-any.whl.
File metadata
- Download URL: convexpi_lab-0.1.0-py3-none-any.whl
- Upload date:
- Size: 35.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fa38b4ed8e1f3dd7d9a9f586980e6347e9a83b38f7970150cc28c85088dae33
|
|
| MD5 |
df917502bbb9e11d4842c5627f5261f9
|
|
| BLAKE2b-256 |
3059e8225cfd026c33f286cbcece2a8ab1275219d901a812e8cd8e0324c962d2
|
Provenance
The following attestation bundles were made for convexpi_lab-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on convexpi/lab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
convexpi_lab-0.1.0-py3-none-any.whl -
Subject digest:
2fa38b4ed8e1f3dd7d9a9f586980e6347e9a83b38f7970150cc28c85088dae33 - Sigstore transparency entry: 1820424644
- Sigstore integration time:
-
Permalink:
convexpi/lab@75325a449273a65e51c6ca28e57f9b0154d13227 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/convexpi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@75325a449273a65e51c6ca28e57f9b0154d13227 -
Trigger Event:
push
-
Statement type: