validation
/validation
Sprawdza, czy wynik backtestu wynika z umiejętności, czy z przypadku przy wielu wariantach, przez probabilistyczny i deflacyjny Sharpe.
- Autor
- ruujOnChain ↗
- Repozytorium
- HedgeFund-Skills ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 07.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 3
- Skrypty
- 1
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 07.11.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
- 1 skrypt w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.
Skrypty: scripts/psr_dsr.py
Co robi i kiedy
Sprawdza, czy wynik backtestu wynika z umiejętności, czy z przypadku przy wielu wariantach, przez probabilistyczny i deflacyjny Sharpe.
Oryginalny opis (EN)
Tests whether a backtest result reflects skill or the luck of trying many variations, using the probabilistic Sharpe ratio and the deflated Sharpe ratio, which adjust for track length, skewness, fat tails, and the number of trials. Use when asked whether a backtest or Sharpe ratio is real, significant, overfit, or worth trusting, or how long a track record needs to be.
Jak działa
- Inputs
- Procedure
- Checks
- Output
- Explaining the result
Podgląd SKILL.md
---
name: validation
description: Tests whether a backtest result reflects skill or the luck of trying many variations, using the probabilistic Sharpe ratio and the deflated Sharpe ratio, which adjust for track length, skewness, fat tails, and the number of trials. Use when asked whether a backtest or Sharpe ratio is real, significant, overfit, or worth trusting, or how long a track record needs to be.
license: MIT
compatibility: Requires Python 3.9 or later with numpy and pandas.
metadata:
owner: research
version: "1.0"
---
# Strategy validation
Answers one question: is this backtest result real? Uses the probabilistic Sharpe ratio (Bailey and López de Prado, 2012) and the deflated Sharpe ratio (Bailey and López de Prado, 2014). Every number comes from `scripts/psr_dsr.py`.
## Inputs
- `returns.csv`: a date column, then periodic returns of the selected strategy (net of costs, excess of cash if available). Complete, no gaps.
- The number of trials: every variation tested on the way to this result, including parameter sets, universes, and rules that were discarded. This input is required. If the user does not know it, ask for their best honest count and state it in the answer.
- The dispersion of results across trials, one of:
- the returns of all trials (`--trial-returns`), or
- their per period Sharpe ratios (`--trial-sharpes`), or
- the variance of per period Sharpe ratios (`--sr-variance`) together with `--trials`.
## Procedure
1. Confirm the selected strategy, the return frequency, and the number of trials.
2. Run the validation:
```bash
python scripts/psr_dsr.py --returns returns.csv --column STRAT \
--trial-returns all_trials.csv --periods-per-year 252
```
or, without trial returns:
```bash
python scripts/psr_dsr.py --returns returns.csv --column STRAT --trials 40 --sr-variance 0.0004
```
3. Read the JSON. If `passed` is false, report the failed check and stop.
4. Report the Sharpe ratio, PSR, the threshold SR0, DSR, and whether DSR clears the confidence level.
## Checks
- At least 60 observations.
- The trial count is at least the number of trials supplied.
- The variance term in the PSR formula is positive.
## Output
`results.sharpe_per_period`, `results.sharpe_annualized`, `skewness`, `kurtosis` (3 for normal returns), `psr` against the benchmark, `sr0_per_period` and `sr0_annualized` (the Sharpe ratio the best of N trials would reach by chance), `dsr`, `passes`, and `min_track_record_length` in periods, plus `checks` and `passed`.
## Explaining the result
- Lead with DSR: the probability that the true Sharpe ratio exceeds what the best of N luckless trials would show. A DSR of 0.95 or more clears the default bar.
- Compare the annualized Sharpe with the annualized SR0, so the reader sees how high the bar was raised by the search.
- Negative skew and fat tails lower PSR and DSR for the same Sharpe ratio. Say so when they matter.
- Minimum track record length is the number of periods needed for DSR to reach the confidence level at the current Sharpe ratio.
- A failing DSR does not prove the idea is wrong. It shows the evidence is not yet strong enough given the search behind it.
For formulas and conventions, see [references/methodology.md](references/methodology.md).
Pliki w paczce (3)
- SKILL.md 3 KB
- references/methodology.md 2 KB
- scripts/psr_dsr.py 6 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · ruujOnChain/HedgeFund-Skills | 100 | MIT |
| mtwuser/zero-cloud-gravity | 100 | MIT |
| hamzabellouch/agent-skills | 100 | MIT |
| minhuw/claude-writer | 100 | MIT |
| richard-kim-79/archora-skills | 100 | MIT |
| matteocervelli/llms | 95 | MIT |
| openai/codex-security | 90 | Apache-2.0 |
| agentic-swe/agentic-swe | 90 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki 805dfae64b41 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100skill-backtest-overfit
Wykrywa przeuczenie backtestu i błąd selekcji z wielokrotnego testowania: oblicza Deflated Sharpe, PBO i minimalną długość historii. - 95ml4t-deflated-sharpe
Koryguje wskaźnik Sharpe'a o obciążenie wielokrotnego testowania przy wyborze z wielu prób, gdy raportuje się wyniki strategii po przeszukiwaniu parametrów lub modeli. - 100sharpe-ratio-non-iid-corrections
Wnioskuje o współczynniku Sharpe'a jednej strategii przy zwrotach nienormalnych i skorelowanych szeregowo, z wariancją Sharpe'a skorygowaną o AR(1), skośność i kurtozę oraz narzędziami PSR, MinTRL, krytyczny Sharpe i moc testu. - 100portfolio-robustness
Stresuje wynik jquantstats: czy Sharpe przetrwa opóźnienie wykonania, koszty, autokorelację, wartości odstające lub inny podokres. - 100backtest-strategy
Wykonuje backtesty strategii inwestycyjnych na danych historycznych: liczy Sharpe ratio, maksymalny drawdown, win rate i zwrot całkowity oraz generuje krzywe kapitału. - 100quant-research
Bada systematyczne sygnały handlowe z dyscypliną profesjonalnego desku kwantowego, sprawdzając nadmierne dopasowanie i błędy patrzenia w przyszłość.