Logo de Backtest Parameter Sensitivity Analysis

Backtest Parameter Sensitivity Analysis

Comunidade
HimanshuJ16
backtest-parameter-sensitivity-analysis

Use após otimizar os parâmetros de uma estratégia, para variar seus valores em uma grade e medir a rapidez com que o Sharpe cai; diferencia um pico frágil de sobreajuste de um platô genuíno. Não reduz o Sharpe selecionado para compensar o número de tentativas.

Add to TypingMind

Visão geral

Publicado porHimanshuJ16
RepositórioAlgo-Trading-Skills
Nome da habilidadebacktest-parameter-sensitivity-analysis
Estrelas
50
Forks
7
Arquivos incluídos
5
LicençaApache-2.0
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Arquivos incluídos: 5

    Scripts, templates e referências que o modelo pode ler enquanto trabalha. Os arquivos são somente para leitura e nunca são executados.

  • Código aberto

    Publicada por HimanshuJ16 no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Backtest Parameter Sensitivity Analysis no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/backtest-parameter-sensitivity-analysis
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

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/backtest-parameter-sensitivity-analysis .claude/skills/backtest-parameter-sensitivity-analysis
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Backtest Parameter Sensitivity Analysis em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Backtest Parameter Sensitivity Analysis automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Backtest Parameter Sensitivity Analysis não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

When to Use

Invoke this skill after optimizing strategy parameters. A strategy whose Sharpe jumps from 0.5 to 3.0 with a $\pm 1%$ parameter tweak is overfit. This skill systematically perturbs parameters across a grid and measures the gradient of Sharpe ratio to distinguish fragile peaks from robust plateaus.

It is a screen, not a certificate. A plateau verdict says the optimum survives a one-step parameter perturbation. It says nothing about out-of-sample performance, regime stability, or whether the Sharpe is real.

When NOT to Use

  • Not a Sharpe deflation. best_sharpe is the maximum over N grid points and is upward-biased by selection even when true skill is zero — it is a maximum of N noisy estimates. Correcting it needs the trial count and the return distribution's higher moments. total_grid_points is reported so you can do that downstream; see factor-research-multiple-testing-correction and the Deflated Sharpe Ratio reference in references/standards.md.
  • Not a multi-parameter analysis. The implementation sweeps one parameter at a time and cannot see interaction effects. A pair of parameters can each look like a plateau in isolation while the joint surface is a knife edge. Sweep a full grid and inspect the surface for that.
  • Not a substitute for out-of-sample testing. Plateau stability is measured entirely in-sample. Use walk-forward-validation-setup and multi-year-regime-coverage-requirement for the out-of-sample question.
  • Not meaningful on a near-zero Sharpe. A flat grid at Sharpe 0.01 is perfectly stable and worthless. Set min_viable_sharpe to your actual deployment hurdle; the 0.0 default only rules out strategies that lose money everywhere.
  • Not usable with a noisy backtest you have not characterised. If re-running the same configuration moves Sharpe by 20%, a 15% degradation threshold measures your simulator's noise, not the strategy's fragility.

Prerequisites

  • Strategy with tunable parameters (e.g., lookback window, entry threshold).
  • Backtest engine that accepts parameter overrides and returns performance metrics.
  • A deterministic backtest, or a known run-to-run Sharpe dispersion to calibrate the degradation threshold against (see backtest-determinism-and-reproducibility).
  • A parameter range wide enough to bracket the optimum on both sides.

Workflow

  1. Define Parameter Grid: Specify parameter ranges and step sizes. Range matters more than resolution: if the best value lands on the first or last point, the optimum is not bracketed and the analyzer returns EDGE_OPTIMUM rather than a verdict.
  2. Run Grid Sweep: Execute backtest for each parameter combination. A non-finite Sharpe (zero return volatility, empty trade log) is rejected rather than swept in — every comparison against NaN is False, so an unguarded NaN silently produces a "robust" result.
  3. Compute Neighbourhood Degradation: Order the grid by parameter value, locate the best point, and measure the relative Sharpe drop to its worst immediate neighbour: $$\text{degradation} = \frac{S_{\text{best}} - \min(S_{\text{left}}, S_{\text{right}})}{S_{\text{best}}}$$ This is a dimensionless ratio, not $\Delta\text{Sharpe}/\Delta\text{Param}$. A raw derivative is not thresholdable across parameters, because 0.2 Sharpe per lookback-day and 0.2 Sharpe per threshold-unit are not comparable quantities.
  4. Classify: The verdict ladder runs viability → coverage → bracketing → degradation, and stops at the first failure:
    • NOT_VIABLE — best Sharpe at or below min_viable_sharpe. A flat grid of losses is stable, not robust.
    • INSUFFICIENT_GRID — fewer than 3 points; a plateau needs a neighbour on each side.
    • EDGE_OPTIMUM — best point is at the boundary, so half its neighbourhood was never observed.
    • FRAGILE_PEAK / ROBUST_PLATEAU — degradation above or within max_neighborhood_degradation_pct.
  5. Deflate Before Believing the Number: Carry total_grid_points forward as the trial count and correct best_sharpe for selection bias before treating it as an expectation.

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

Common Pitfalls

  • Single-Parameter Analysis Only: Ignoring interaction effects between correlated parameters. This tool is itself single-parameter — see "When NOT to Use".
  • Too Fine Grid: Overfitting the grid search itself. Every extra grid point is another trial inflating the maximum.
  • Unordered Grid: Neighbours must be taken in parameter order. Indexing into the caller's list order lets the same set of results be classified either way depending on how it was assembled — this analyzer sorts by parameter value to prevent it.
  • Unbracketed Optimum: A monotonically improving parameter puts the best value at the edge of whatever range you happened to sweep. That is a statement about your grid, not about a plateau. Widen the range.
  • A Stable Loser Reported as Robust: If degradation is only computed when the best Sharpe is positive, a grid where every configuration loses money scores zero degradation and passes the plateau test.
  • Treating a Plateau as Permission to Deploy: The verdict covers one parameter, in-sample, at one grid resolution. It is one input to a deployment decision, not the decision.
  • Threshold Below Simulator Noise: A degradation threshold tighter than your backtest's own run-to-run dispersion flags noise as fragility.

Verification

  • Run a monotonically increasing Sharpe curve and confirm the verdict is EDGE_OPTIMUM, not a plateau.
  • Run a grid where every Sharpe is negative and confirm the verdict is NOT_VIABLE.
  • Shuffle a grid's list order and confirm the verdict, degradation and best parameters are unchanged.
  • Assert the hand-computed boundary: best 4.0 against worst neighbour 3.0 is exactly $(4-3)/4 = 0.25$ degradation, which is robust at a 0.25 threshold and fragile at anything tighter.
  • Confirm a single grid point returns INSUFFICIENT_GRID rather than a robustness verdict.
  • Run python -m unittest discover -s skills/backtest-parameter-sensitivity-analysis/scripts — 100% pass rate.

Related Skills

  • walk-forward-validation-setup
  • multi-year-regime-coverage-requirement
  • factor-research-multiple-testing-correction
  • monte-carlo-strategy-robustness-testing
  • backtest-determinism-and-reproducibility

Arquivos incluídos

O modelo lê esses arquivos sob demanda enquanto a habilidade está carregada. Eles são disponibilizados para leitura e nunca são executados.

Perguntas frequentes

O que a habilidade de IA Backtest Parameter Sensitivity Analysis faz?

Use após otimizar os parâmetros de uma estratégia, para variar seus valores em uma grade e medir a rapidez com que o Sharpe cai; diferencia um pico frágil de sobreajuste de um platô genuíno. Não reduz o Sharpe selecionado para compensar o número de tentativas.

Por que usar Backtest Parameter Sensitivity Analysis no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Backtest Parameter Sensitivity Analysis é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Backtest Parameter Sensitivity Analysis no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/backtest-parameter-sensitivity-analysis. O TypingMind lê o arquivo SKILL.md, reúne os arquivos da habilidade e a instala para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Backtest Parameter Sensitivity Analysis?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Backtest Parameter Sensitivity Analysis?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Backtest Parameter Sensitivity Analysis com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Backtest Parameter Sensitivity Analysis é gratuita?

Sim. A habilidade é publicada no GitHub por HimanshuJ16 sob a licença Apache-2.0. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇