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 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

convexpi_lab-0.1.1.tar.gz (55.5 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.1.1-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: convexpi_lab-0.1.1.tar.gz
  • Upload date:
  • Size: 55.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for convexpi_lab-0.1.1.tar.gz
Algorithm Hash digest
SHA256 51bf5560455ca5c71f990970e700723fa6d7526fb3706e91c4eb9c8ca2d18b4c
MD5 d3854b4b5d69cbd922a8bce069c81303
BLAKE2b-256 6d765588a5c0e6c8dd2a7ed6d63b990759fb9d70e7241e18ba14b34fb41d5837

See more details on using hashes here.

File details

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

File metadata

  • Download URL: convexpi_lab-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 36.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for convexpi_lab-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3aaeb1997a2ce7a8a41a183f466a08ced835433d22cef18cc77ad0bc52b9a5cc
MD5 5d46e71527c5cf28f5d7d3d4dde89954
BLAKE2b-256 1e2eca20cef6c43528331cb88e7a6a05442930b3de3e50bda503bdf044b3c1f3

See more details on using hashes here.

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