Skip to main content

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 across the canonical factor zoo
  • 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

convexpi_lab-0.3.0.tar.gz (239.4 kB view details)

Uploaded Source

Built Distribution

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

convexpi_lab-0.3.0-py3-none-any.whl (44.6 kB view details)

Uploaded Python 3

File details

Details for the file convexpi_lab-0.3.0.tar.gz.

File metadata

  • Download URL: convexpi_lab-0.3.0.tar.gz
  • Upload date:
  • Size: 239.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for convexpi_lab-0.3.0.tar.gz
Algorithm Hash digest
SHA256 109c559f3d2248053f26a01fe9fa1c64969f09bdbd33dbe10f99fe2c4eece9c9
MD5 85a29316e4afd8706c5c28aca2e230ff
BLAKE2b-256 70091537b467e456d8147a6eef3adffb699222f283d06c7767a8774621f2d31e

See more details on using hashes here.

Provenance

The following attestation bundles were made for convexpi_lab-0.3.0.tar.gz:

Publisher: publish.yml on convexpi/lab

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

File details

Details for the file convexpi_lab-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: convexpi_lab-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 44.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for convexpi_lab-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec7d3401826943fff131499c61d663c2143032a2e44dd976a978067f2e6fdeb8
MD5 fcbbcf8639f60c4ba8f3db5a87a6e363
BLAKE2b-256 3c5170f420ec6c5e83b4eb411447ca8c1de35ae5827cfab1fba2aa284746f944

See more details on using hashes here.

Provenance

The following attestation bundles were made for convexpi_lab-0.3.0-py3-none-any.whl:

Publisher: publish.yml on convexpi/lab

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page