Certifier — an honest backtest gate whose default answer is NO. Deflated-Sharpe + ruin-floor certification.
Project description
Certifier — an honest backtest gate whose default answer is NO
Most backtest tooling is built to make a strategy look good. This does the opposite: it is engineered to reject a backtest — including its authors' own — unless the edge survives every discount a skeptical statistician would apply.
Free and MIT-licensed. numpy + the Python standard library, nothing else.
Try it in 30 seconds (browser, nothing uploaded)
https://rocomas.github.io/certifier-demo/ — the whole gate runs client-side. Click Load an overfit, then Certify, and watch the best of 400 pure-noise strategies get REJECTED.
What it checks
Feed it a return series and the honest size of the search that produced the strategy. It returns CERTIFIED only if:
- Deflated Sharpe ≥ 0.95 (Bailey & López de Prado), deflated for
- the best-of-N selection that produced the edge — a bigger search raises the bar,
- the return distribution's skew and kurtosis,
- an optional publication-decay haircut (
--haircut 0.5for known anomalies), - an optional overlapping-window correction (
--overlap-lag h-1);
- it survives a ruin floor — a $1 book compounding the returns never draws down past the floor (default 51%).
Both must hold. Thin samples, overfit selections, decayed edges, and ruinous paths are all rejected.
Install
pip install dsr-gate # PyPI name: dsr-gate; import name: certifier
# or straight from source:
pip install git+https://github.com/Rocomas/certifier
(The PyPI name certifier was already taken by an unrelated TLS package — hence
dsr-gate. The module and CLI are both called certifier.)
Use
certifier returns.csv --trials 200 # one return per line; exit 0/1 for CI
certifier returns.csv --trials 200 --haircut 0.5 --overlap-lag 4
echo "0.01,0.02,-0.005" | certifier - --trials 50
python -m certifier.webdemo # local copy of the browser demo
from certifier import certify_returns
res = certify_returns(my_returns, n_trials=200, haircut=0.5, overlap_lag=4)
print(res["verdict"], res["dsr"], res["ruin"]["survives"])
Reproduce the money shot
python examples/demo.py # dredges the best of 500 noise trials; the certifier kills it
overfit sharpe=+0.17 DSR=0.360/0.95 ruin_ok=True -> REJECTED
real sharpe=+1.96 DSR=1.000/0.95 ruin_ok=True -> CERTIFIED
Same family of Sharpes, opposite verdicts. examples/overfit.csv and examples/real.csv
are committed so you can verify from the CLI.
The honest caveat (and what's coming)
The verdict is only as honest as your n_trials. Most researchers genuinely don't know
how many strategies they tried — every discarded variation counts. We're building the
layer that fixes that: a trial ledger that hooks your research loop, records every
backtest automatically, and certifies against counted trials, not claimed ones — plus a
CI gate and a signed certification report. The calculator here is free forever; the
ledger/workflow layer will be a paid tier. Watch/star this repo to hear when it lands.
What it is not
It does not tune, fit, or optimize anything. A CERTIFIED verdict is a statement about historical evidence, not investment advice and not a guarantee of future returns.
License
MIT. Math: Bailey & López de Prado, The Deflated Sharpe Ratio (2014), implemented
inline in ~200 lines — audit certifier/dsr.py and certifier/gate.py yourself.
Project details
Release history Release notifications | RSS feed
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 dsr_gate-0.1.0.tar.gz.
File metadata
- Download URL: dsr_gate-0.1.0.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cf5e92cb31895524e422088977b4b00627d1d8e4940b2ad018727b23a2ef97a
|
|
| MD5 |
ba8369367a854105bcdb095892a1b7d5
|
|
| BLAKE2b-256 |
e85cc6c7cece11105ebbe6595103eb677191b48cd9a8e967b3a1efe665e048e7
|
File details
Details for the file dsr_gate-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dsr_gate-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ee3f4b1f774a5adb42503cac45c5e820ff476c3fa63dc74738c6485f7d39474
|
|
| MD5 |
69d7326ada15894e2e2c32b4360e1f58
|
|
| BLAKE2b-256 |
53e076c499568db4f2891bbc53926f92a40fb0a6af2eabe72fec5f1c7085352c
|