cleoanka
TR

The Causality Court

Look-ahead bias checker

Drop in your strategy and your price data; the checker tests whether the signal sees the future and writes a printable indictment. It looks for look-ahead bias: a signal at time t that uses data from after t.

Your code and data never leave this device; you can verify this in the Network tab. The only requests that send data are Cloudflare’s cookieless page-view counts (/cdn-cgi/rum); they carry no file content.

Inputs

Both use the same synthetic prices.

1 Strategy

or paste the code below

2 Prices

no data yet

If you enter it, the deflated Sharpe is computed; if not, it is skipped.

What the checker looks at

Truncation invariance
Cuts the data at bar t, for up to 50 values of t, and runs signal again. If the signal up to t changes, it is reading what comes after t. The first bar where the leak shows and the line of code behind it are reported.
Lag stress
Delays the trades by 0 to 5 bars. A strategy that sees the future collapses at a one-bar delay; an honest but fragile one shows up here too.
Future shuffle
Shuffles the rows after t; the signal up to t must not change. Leaks that shuffling cannot move, such as the mean of the whole sample, are caught by the truncation test.
Six code rules
A negative shift, a center=True window, fit on the whole sample, bfill, trading on the same bar’s return, and resample without label=/closed=.
Deflated Sharpe
If you enter how many trials you ran, it uses Bailey and López de Prado’s (2014) method to estimate how far the best trial stands from luck.

What the files should look like

The strategy is Python code that defines a signal(df) function returning a pandas Series with the same index as df: +1 long, −1 short, 0 flat. The signal uses what is known at that bar’s close; the trade happens on the next bar.

The CSV needs a time column (date, time, timestamp or the first column) and a close column; open, high, low, volume and other columns come along. Column names are lower-cased, times are converted to UTC, unsorted rows are sorted and empty closes are dropped; the indictment lists each of these. Python, numpy 2.2.5 and pandas 2.3.3 run in your browser through Pyodide 0.29.5, loaded from this site.

The Causality Certificate

After every finished audit your browser produces a certificate: the SHA-256 digests of the strategy and data files, of the checker code and of the audit result, with the verdict. An audit that could not finish gets none, and neither does one that stopped halfway without proving a leak. The moment you edit the code or load new data, the certificate is withdrawn.

Nobody signs it; its worth is that anyone can run the same files with the same setting (number of trials) through the same checker version and reach the same audit_sha256. audit_sha256 is the digest of the audit JSON in canonical form: keys sorted at every level, arrays kept in order, no whitespace. The fields are defined in the JSON schema.

What this checker cannot catch

Not investment advice; no signals.

Request a full audit Read the essay: The Causality Court Look-ahead bias: one door against the future The kairos lab