Logo di Backtest Parameter Sensitivity Analysis

Backtest Parameter Sensitivity Analysis

Community
HimanshuJ16
backtest-parameter-sensitivity-analysis

Usalo dopo aver ottimizzato i parametri di una strategia: variali su una griglia e misura la rapidità con cui lo Sharpe decade, così da distinguere un picco fragile dovuto all’overfitting da un plateau autentico. Non corregge lo Sharpe selezionato in base al numero di tentativi.

Add to TypingMind

Panoramica

Pubblicato daHimanshuJ16
RepositoryAlgo-Trading-Skills
Nome della skillbacktest-parameter-sensitivity-analysis
Stelle
50
Fork
7
File inclusi
5
LicenzaApache-2.0
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • File inclusi: 5

    Script, template e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da HimanshuJ16 su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Backtest Parameter Sensitivity Analysis in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/backtest-parameter-sensitivity-analysis
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'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
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Backtest Parameter Sensitivity Analysis in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Backtest Parameter Sensitivity Analysis non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Backtest Parameter Sensitivity Analysis non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello 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

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Backtest Parameter Sensitivity Analysis?

Usalo dopo aver ottimizzato i parametri di una strategia: variali su una griglia e misura la rapidità con cui lo Sharpe decade, così da distinguere un picco fragile dovuto all’overfitting da un plateau autentico. Non corregge lo Sharpe selezionato in base al numero di tentativi.

Perché usare Backtest Parameter Sensitivity Analysis su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Backtest Parameter Sensitivity Analysis è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Backtest Parameter Sensitivity Analysis in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/backtest-parameter-sensitivity-analysis. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Backtest Parameter Sensitivity Analysis?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Backtest Parameter Sensitivity Analysis?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Backtest Parameter Sensitivity Analysis: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Backtest Parameter Sensitivity Analysis è gratuita?

Sì. È pubblicata su GitHub da HimanshuJ16 con licenza Apache-2.0. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇