Logo : Benchmark Selection For Strategy Evaluation

Benchmark Selection For Strategy Evaluation

Communauté
HimanshuJ16
benchmark-selection-for-strategy-evaluation

À utiliser pour choisir l’indice de référence auquel comparer une stratégie, avant toute attribution ; évalue les indices candidats selon l’erreur de suivi, le bêta et le R² afin qu’un portefeuille très exposé à la tech ne soit pas avantagé par un indice généraliste ou un taux sans risque.

Add to TypingMind

Présentation

ÉditeurHimanshuJ16
DépôtAlgo-Trading-Skills
Nom de la compétencebenchmark-selection-for-strategy-evaluation
Étoiles
50
Forks
7
Fichiers inclus
5
LicenceApache-2.0
Liens
  • Instructions en Markdown

    Un fichier SKILL.md que le modèle charge à la demande : il ne consomme donc des tokens que lorsqu’une demande correspond réellement à la compétence.

  • Compatible avec tous les LLM

    Les compétences IA sont rédigées en Markdown et non sous forme de code propre à un fournisseur. Elles fonctionnent donc avec GPT, Claude, Gemini, Grok ou un modèle local.

  • Fichiers inclus : 5

    Des scripts, des gabarits et des références que le modèle peut consulter pendant son travail. Les fichiers sont en lecture seule et ne sont jamais exécutés.

  • Open source

    Publiée par HimanshuJ16 sur GitHub. Consultez les sources avant de l’installer.

Installation

Installez la compétence IA Benchmark Selection For Strategy Evaluation dans TypingMind pour l’utiliser avec n’importe quel LLM, ou ajoutez-la à un autre agent capable de lire SKILL.md.

1

Installer dans TypingMind

TypingMind installe une compétence directement depuis son dossier GitHub : l’application lit SKILL.md, regroupe les fichiers de ressources et enregistre le tout localement.

  1. Ouvrez l’application et accédez à Plugins → Compétences.
  2. Choisissez « Installer depuis GitHub ».
  3. Copiez l’URL ci-dessous, qui pointe vers le dossier de la compétence, puis collez-la et confirmez.
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/benchmark-selection-for-strategy-evaluation
  4. Activez la compétence dans chaque discussion où vous souhaitez pouvoir l’utiliser.
Plugins → Compétences → Ajouter une compétence → Via une URL GitHub, puis collez l’URL du dossier et appuyez sur Continuer.
2

Installer dans un autre agent

Tout agent capable de lire le format Agent Skills peut utiliser cette compétence : copiez le dossier dans le répertoire des compétences de cet agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/HimanshuJ16/Algo-Trading-Skills.git /tmp/Algo-Trading-Skills
mkdir -p .claude/skills
cp -r /tmp/Algo-Trading-Skills/skills/benchmark-selection-for-strategy-evaluation .claude/skills/benchmark-selection-for-strategy-evaluation
Redémarrez Claude Code après la copie pour que la nouvelle compétence soit prise en compte.

Utilisez cette compétence dans TypingMind

Activez Benchmark Selection For Strategy Evaluation dans n’importe quelle discussion TypingMind et le modèle s’occupe du reste. Le nom et la description de la compétence figurent dans le prompt système. Dès qu’une demande correspond, le modèle charge lui-même l’intégralité des instructions : vous n’avez jamais à l’invoquer manuellement, et elle ne consomme aucun token tant qu’elle n’est pas utilisée.

Le modèle charge automatiquement Benchmark Selection For Strategy Evaluation dès qu’une demande correspond à cette compétence.

Compatible avec tous les modèles IA

Les compétences IA sont de simples instructions Markdown, et non du code propre à un fournisseur. Ainsi, la compétence Benchmark Selection For Strategy Evaluation n’est pas liée au modèle pour lequel elle a été conçue. Installez-la une seule fois dans TypingMind et utilisez-la avec GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou un modèle local que vous exécutez vous-même, le tout avec vos propres clés API.

  • Chargée uniquement en cas de besoin

    Le prompt système ne contient que le nom et la description. Les instructions sont récupérées à la première demande correspondante : une compétence inutilisée ne coûte donc rien.

  • Changez de modèle en cours de discussion

    La compétence étant constituée d’instructions et non de code, elle reste fonctionnelle lorsque vous changez de modèle : le nouveau modèle lit le même fichier SKILL.md.

Instructions de la compétence

Voici le contenu de SKILL.md que le modèle charge. Lisez-le avant l’installation : une compétence contient des instructions que votre modèle suivra.

Benchmark Selection for Strategy Evaluation

When to Use

Use this skill when evaluating a new strategy. Selecting the right benchmark is crucial; if you run a tech-heavy long-only strategy, benchmarking it against a risk-free rate or a generic broad index will make it look artificially good during tech bull markets.

BenchmarkSelector screens candidate benchmarks by how closely each one replicates the strategy's return stream, reporting tracking error, information ratio, beta, and R².

When NOT to Use

  • To compute alpha. This screen measures active return (strategy − benchmark) with no beta adjustment. A strategy with beta 1.5 to its benchmark will show active return that is mostly leveraged beta, not skill. For a beta-adjusted attribution use strategy-performance-attribution-vs-market-beta.
  • To pick a benchmark after seeing results. Ranking candidates post hoc and keeping the flattering one is benchmark selection bias. The screen is for confirming a pre-specified shortlist.
  • As a substitute for benchmark validity. Investability, unambiguity, measurability, and "specified in advance" are properties of the benchmark's construction that no return-series statistic can observe.
  • On a handful of observations. With two data points correlation is ±1 by construction. Short samples produce confident-looking numbers with no content.

Prerequisites

  • Time series of strategy returns (at least 2 observations; realistically far more).
  • Time series of candidate benchmark returns (e.g., SPY, QQQ, sector ETFs, risk-free rate), total return and date-aligned to the strategy.
  • The return frequency, so periods_per_year can be set correctly.

Workflow

  1. Fix the candidate list first. Write down the candidates and the selection rule before running anything — otherwise the screen becomes a search for the most flattering comparator.
  2. Confirm total-return series. A price-only index understates the benchmark by roughly its dividend yield per year, which the strategy then "outperforms" for free.
  3. Align the series. Equal length is enforced; a one-day shift is not detectable by the tool and silently contaminates every statistic. Align on an explicit date index upstream.
  4. Set the conventions. periods_per_year must match the data frequency — leaving a monthly series at the 252 default overstates tracking error by √21 ≈ 4.6x. ddof=1 (sample) is the default; use ddof=0 if your reporting standard requires the population convention.
  5. Run evaluate_benchmarks(strategy_returns). Results are sorted by ascending tracking error — the closest-replicating benchmark first.
  6. Read beta before accepting the top row. If the best-fitting candidate has beta far from 1.0, it has the right exposure at the wrong scale; if r_squared is low, no candidate explains the strategy and you may need a multi-factor or absolute-return comparator.
  7. Check for nan and ±inf before quoting anything. nan correlation means the benchmark has zero variance (a flat risk-free series) — correlation is undefined there, not zero. ±inf information ratio means zero active risk with non-zero active return.
  8. Confirm the qualitative properties, then freeze. Verify the winner is investable and unambiguous, record the benchmark with its periods_per_year/ddof conventions and date range, and do not change it mid-evaluation.

Full procedure: see references/workflows.md. Standards reference: see references/standards.md. Printable pre-flight checklist: see assets/checklist.md.

Common Pitfalls

  • Defaulting to SPY: Using SPY as a benchmark for everything (e.g., a bond strategy, a short-only strategy, a crypto strategy).
  • Ignoring Risk-Free Rate: For market-neutral absolute return strategies, the risk-free rate or a very low-volatility benchmark is appropriate. If the risk-free series wins the screen for a market-neutral strategy, that is the correct answer, not a defect.
  • Ranking by correlation: Correlation is scale-invariant, so a 3x-levered clone of the strategy scores a perfect 1.00 while producing roughly 12x the tracking error of a properly scaled benchmark. Rank by tracking error and use beta to detect scale mismatch.
  • Calling active return alpha: strategy − benchmark is active return. Alpha requires adjusting for beta; a high-beta strategy in a rising market shows large active return and zero skill.
  • Price-only benchmark series: Comparing a dividend-receiving strategy against a price index hands it the dividend yield as free outperformance every year.
  • Wrong annualisation factor: Tracking error and the information ratio both scale with √periods_per_year. A monthly series scored at 252 produces numbers that are wrong by a factor of 4.6 in opposite directions.
  • Treating a nan correlation as zero: A flat risk-free benchmark has no variance, so correlation is undefined. Reporting 0.0 there makes the benchmark look deliberately uncorrelated when nothing was measured at all.
  • Benchmark shopping: Re-running the screen after a bad quarter and switching to whichever benchmark now looks better violates "specified in advance" and invalidates the entire comparison.

Verification

  • Verify that Information Ratio correctly rewards excess return relative to tracking error.
  • Check that a benchmark matching the strategy in both shape and scale yields lower tracking error than one matching only in shape. High correlation alone does not imply low tracking error: confirm the tool does not recommend a 3x-levered clone of the strategy, which correlates at exactly 1.00 and is a terrible benchmark (test_leveraged_clone_is_not_recommended).
  • Confirm a flat risk-free benchmark yields nan correlation rather than 0.0.
  • Confirm tracking error matches an independently computed sample standard deviation of active returns, annualised.
  • Run python -m unittest discover -s skills/benchmark-selection-for-strategy-evaluation/scripts and confirm a 100% pass rate.

Related Skills

  • backtest-reporting-standardized-tearsheet
  • benchmark-relative-performance-attribution
  • strategy-performance-attribution-vs-market-beta
  • risk-adjusted-performance-attribution-per-strategy

Fichiers inclus

Le modèle lit ces fichiers à la demande lorsque la compétence est chargée. Ils sont accessibles en lecture et ne sont jamais exécutés.

Foire aux questions

À quoi sert la compétence IA Benchmark Selection For Strategy Evaluation ?

À utiliser pour choisir l’indice de référence auquel comparer une stratégie, avant toute attribution ; évalue les indices candidats selon l’erreur de suivi, le bêta et le R² afin qu’un portefeuille très exposé à la tech ne soit pas avantagé par un indice généraliste ou un taux sans risque.

Pourquoi utiliser Benchmark Selection For Strategy Evaluation sur TypingMind ?

Parce que vous l’installez une seule fois pour l’utiliser avec n’importe quel modèle. Benchmark Selection For Strategy Evaluation se compose de simples instructions en Markdown plutôt que de code propre à un fournisseur. La même compétence fonctionne donc avec GPT-5, Claude, Gemini, Grok ou un modèle local, et vous pouvez changer de modèle en cours de discussion sans perturber son fonctionnement. TypingMind utilise vos propres clés API : vous payez donc directement les fournisseurs plutôt qu’un abonnement par siège, et vos compétences et discussions restent dans votre propre espace de stockage.

Comment installer Benchmark Selection For Strategy Evaluation dans TypingMind ?

Dans TypingMind, ouvrez Plugins → Compétences → Installer depuis GitHub et collez https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/benchmark-selection-for-strategy-evaluation. TypingMind lit le fichier SKILL.md, regroupe les fichiers associés et installe le tout sous forme de compétence que vous pouvez activer pour chaque discussion.

Quels modèles d’IA peuvent utiliser Benchmark Selection For Strategy Evaluation ?

N’importe quel modèle que vous connectez dans TypingMind. Les compétences IA sont de simples instructions en Markdown, et non du code propre à un fournisseur. GPT, Claude, Gemini, Grok et les modèles locaux peuvent donc tous charger cette compétence lorsqu’une demande lui correspond.

Combien de modèles d’IA puis-je utiliser avec Benchmark Selection For Strategy Evaluation ?

Autant que vous le souhaitez. Vous pouvez utiliser Benchmark Selection For Strategy Evaluation avec tout modèle qui prend en charge les compétences : GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama et bien d’autres, le tout dans TypingMind avec vos propres clés API.

La compétence IA Benchmark Selection For Strategy Evaluation est-elle gratuite ?

Oui. Cette compétence est publiée sur GitHub par HimanshuJ16 sous licence Apache-2.0. Vous ne payez que votre propre fournisseur d’IA pour les tokens utilisés.

Que sont les compétences IA ?

Une compétence IA est un ensemble d’instructions réutilisables qui apprend à un modèle d’IA à accomplir une tâche précise. Elle suit le format ouvert Agent Skills : un fichier SKILL.md contenant un nom et une description, ainsi que les éventuels scripts, gabarits ou fichiers de référence dont le modèle peut avoir besoin. Le modèle ne lit les instructions que lorsque votre demande correspond à la compétence. Une compétence installée ne coûte donc rien tant qu’elle n’est pas utilisée.

En quoi les compétences IA diffèrent-elles des plugins ou des serveurs MCP ?

Un plugin ou un serveur MCP fournit au modèle de nouveaux outils à appeler : du code qui s’exécute quelque part et renvoie un résultat. Une compétence IA lui apporte plutôt des connaissances et une méthode : comment aborder une tâche, quelles étapes suivre et à quoi ressemble un bon résultat. Les compétences sont de simples instructions en Markdown. Elles ne nécessitent donc ni serveur, ni clé API, ni environnement d’exécution, et fonctionnent avec n’importe quel modèle.

Tout voir

Créez votre propre espace de travail IA dès maintenant

Abonnez-vous à notre newsletter pour être informé des nouvelles fonctionnalités et des prochains cadeaux à gagner 👇