Metadata-Version: 2.4
Name: disprove
Version: 0.1.0
Summary: The strategy evidence engine: honest PASS/WARN/BLOCK verdicts on trading strategies. Its credential: it blocked its own flagship strategy.
Project-URL: Homepage, https://github.com/866y4tb8hc-coder/disprove
Author: Vadims
License: MIT
License-File: LICENSE
Keywords: audit,backtesting,evidence,quant,trading,validation
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.10
Requires-Dist: numpy>=1.26
Requires-Dist: polars>=1.0
Requires-Dist: scipy>=1.11
Description-Content-Type: text/markdown

# Disprove

**The strategy evidence engine.** Disprove decides whether a trading strategy
has earned the right to risk money — and refuses when it hasn't.

```
pip install disprove
```

## Its credential: it blocked its own flagship strategy

Disprove was extracted from a private trading-research system whose best
strategy — delta-neutral funding-rate carry, 6.7 years of real Binance data,
**+11.8%/yr average** — looked fundable by every conventional measure. The
fixed-horizon audit returned **BLOCK**: only ~1 month in 3 was actually clean;
the average was carried by two hot regimes. Thresholds were anchored to
observables and committed in writing *before* the run. The verdict was
accepted and the strategy was never funded.

A validation tool that has never rejected its owner's favorite idea is a
rubber stamp. Read the full story: [docs/case-study.md](docs/case-study.md).

## 60-second demo (no keys, no data, no network)

```bash
python examples/run_synthetic_audit.py
```

```text
consistent   -> PASS  (4P/0W/0B of 4, pass_ratio=1.00, reasons=clean)
inconsistent -> WARN  (1P/3W/0B of 4, pass_ratio=0.25, reasons=['pass_ratio_below_threshold'])
gapped       -> BLOCK (3P/0W/2B of 5, pass_ratio=0.60, reasons=['blocked_chunks_present'])
```

The third line is the point: a **profitable-looking history with missing data
is blocked on integrity** — before performance is even considered.

## What it does

1. **Fixed-horizon chunks.** Your strategy's history is split into fixed
   calendar windows (default 30 days). Every window between first and last
   observation is emitted — missing history cannot disappear from the count.
2. **Integrity blocks.** Partial windows, data gaps, and thin chunks BLOCK.
   Untrustworthy evidence is not neutral; it is disqualifying.
3. **Per-chunk verdicts.** PASS needs positive fee-adjusted PnL and bounded
   drawdown *inside each window* — a pretty average cannot hide bad months.
4. **An overall verdict you committed to in advance.** Anchor your thresholds
   to observables (your max drawdown, your monthly expectancy), write them
   down, then run. `evaluate_overall_verdict` does the rest.

```python
from disprove import (
    CostModel, CarryAuditPolicy, FixedHorizonChunkPolicy,
    audit_funding_carry_chunks,
)

audit = audit_funding_carry_chunks(
    funding_frame,                      # polars: funding_time (ms), funding_rate
    cost_model=CostModel(spot_fee_bps=10, perp_fee_bps=5, half_spread_bps=1, slippage_bps=2),
    policy=CarryAuditPolicy(window=6, notional_usdt=10_000),
    chunk_policy=FixedHorizonChunkPolicy(
        catastrophic_net_loss_usdt=-150.0,  # anchor: your full-history maxDD
        max_pass_drawdown_usdt=40.0,        # anchor: one month's expected profit
    ),
    horizon_ms=30 * 24 * 3600 * 1000,
)
print(audit.overall.verdict)            # PASS | WARN | BLOCK — with receipts
```

Also included: cost-charged vectorized carry backtests (`run_backtest`,
basis-aware `run_backtest_v2`), deflated Sharpe and walk-forward splits
(`disprove.metrics`, `disprove.walkforward`), and a CLI (`disprove --help`)
that writes auditable Markdown + CSV verdict artifacts.

## What this is not

- Not a signal service. Not a profit bot. **No profitability claims** — the
  flagship case study documents a rejection; that is the product.
- Not a full backtesting framework: it is the *judgment layer* you put on top
  of whichever one you use.

## Provenance

Extracted from a private research system with 1,000+ tests; this public core
ships with its own test suite and CI. The private system also rejected, with
receipts: orderbook scalping for non-colocated operators (fees + adverse
selection) and cross-sectional funding rotation (turnover costs).

## Paid: independent audits

The author runs this gate against client strategies under pre-committed
thresholds — your rules, your data window, an honest verdict with receipts.
Contact via GitHub issues or the email in the commit log.

MIT licensed.
