Logo di Backtest Reporting Standardized Tearsheet

Backtest Reporting Standardized Tearsheet

Community
HimanshuJ16
backtest-reporting-standardized-tearsheet

Usalo al termine di un backtest per generare una scheda standard delle prestazioni (Sharpe, Sortino, Calmar, drawdown massimo, percentuale di operazioni vincenti, profit factor) a partire da un array dei rendimenti per periodo, così da confrontare le strategie usando metriche identiche.

Add to TypingMind

Panoramica

Pubblicato daHimanshuJ16
RepositoryAlgo-Trading-Skills
Nome della skillbacktest-reporting-standardized-tearsheet
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 Reporting Standardized Tearsheet 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-reporting-standardized-tearsheet
  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-reporting-standardized-tearsheet .claude/skills/backtest-reporting-standardized-tearsheet
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Backtest Reporting Standardized Tearsheet 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 Reporting Standardized Tearsheet 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 Reporting Standardized Tearsheet 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 at the conclusion of every backtest run. Reporting fragmented or customized performance metrics makes comparing different trading strategies subject to cherry-picking bias. Generating a standardized performance tearsheet ensures every strategy is benchmarked against identical risk-adjusted returns, downside risk, trade statistics, and drawdown distribution rules.

"Standardized" only holds if the conventions are pinned down, because the same returns produce different Sharpe and Calmar values under different defensible choices. This implementation fixes them explicitly and references/standards.md records each one with its source.

When NOT to Use

  • Not a trade-level analysis. The generator consumes a per-period returns array. Hit Rate is the fraction of periods that were positive, which is not the same number as a per-trade win rate — a strategy holding one winning trade across 20 flat days has a 100% trade win rate and a 5% daily hit rate. For per-trade statistics, aggregate the trade log first and feed per-trade returns with periods_per_year set accordingly.
  • Not a compliance-ready performance presentation. Under the SEC Marketing Rule, 17 CFR § 275.206(4)-1(e)(8), backtested results are hypothetical performance: "performance results that were not actually achieved by any portfolio of the investment adviser". A US-registered investment adviser putting this tearsheet in an advertisement must satisfy the conditions in § 275.206(4)-1(d)(6). This is a US adviser-advertising rule; it does not govern internal research. Check the rule and your own jurisdiction before distributing.
  • Not a correction for selection bias. These are descriptive statistics for one backtest. If the parameters were chosen by searching many configurations, the reported Sharpe is the maximum of many noisy estimates and overstates expectation. See backtest-parameter-sensitivity-analysis and factor-research-multiple-testing-correction.
  • Not a verdict. Nothing here says a strategy is deployable. Pair it with out-of-sample and regime evidence.
  • Not for log returns. Inputs must be simple per-period returns; the equity curve compounds them as $\prod(1+R_t)$.

Prerequisites

  • Daily portfolio returns series $R_t$ as simple decimal returns, chronologically ordered, with no gaps.
  • Annual risk-free rate $r_f$ (e.g. 0.04) on the same annualization basis as periods_per_year.
  • At least 2 observations; annualized figures from less than one year are flagged, not suppressed.

Workflow

  1. Set the Annualization Basis First: periods_per_year must match the sampling frequency — 252 daily, 52 weekly, 12 monthly. Using 365 on a trading-day series overstates annualized volatility by roughly 20% and understates Sharpe by the same factor.
  2. Calculate Risk-Adjusted Ratios: Sharpe uses arithmetic annualized excess return over annualized sample standard deviation (ddof=1). Sortino replaces the denominator with target downside deviation, averaging the squared below-target shortfalls over all periods rather than only the losing ones. Calmar divides CAGR by the absolute maximum drawdown; the excess-return variant is available via calmar_uses_excess_return and the report labels which was used.
  3. Compute Drawdown Statistics: Maximum drawdown is measured on an equity curve seeded at 1.0, so a decline starting on the first period counts against starting capital. Also reported: periods from peak to trough, and periods from trough back to the prior peak (None if never recovered).
  4. Compute Per-Period Trade Statistics: Hit rate, profit factor (gross win / gross loss) and average win/loss, all on periods, not trades.
  5. Read the Degenerate Values Literally: A zero denominator returns $\pm\infty$ or nan, never 0.0. An infinite Sharpe means zero variance, not a bad strategy; a nan profit factor means there were neither gains nor losses.
  6. Format Tearsheet Summary: Generate structured report dictionary for standardized presentation, carrying Periods, Calmar Convention and Annualization Extrapolated alongside the metrics so the numbers stay interpretable.

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

Common Pitfalls

  • Annualizing Sharpe with Wrong Frequency: Multiplying daily Sharpe by $\sqrt{365}$ instead of trading days $\sqrt{252}$.
  • Ignoring Downside Volatility: Reporting high Sharpe for strategies with severe left-tail crash risk (negative skewness).
  • Unseeded Drawdown Curve: Starting the running maximum at the first period's close instead of at starting capital. A series that opens $-50%$ then recovers slightly reports a maximum drawdown of zero, and three consecutive $-10%$ periods report $-19%$ instead of the true $-27.1%$.
  • Dividing Downside Deviation by the Losing Periods: Averaging squared shortfalls over only the below-target observations instead of all of them inflates Sortino — by a factor of 2 in a series where a quarter of the periods are losses.
  • Silent NaN: A NaN return leaves hit rate and profit factor looking perfectly normal while every risk statistic becomes nan, producing a report that is half plausible. Reject it at the boundary.
  • Annualizing a Handful of Periods: One $+5%$ day compounds to over $20{,}000{,}000%$ per year. The figure is arithmetically correct and completely meaningless.
  • Reporting 0.0 for a Degenerate Denominator: A flawless constant-return curve has infinite Sharpe and infinite Calmar. Collapsing those to 0.0 makes the best possible result look like one of the worst. Note also that numpy.std of a constant series returns rounding error near $10^{-18}$, not exact zero, so an unguarded division yields an absurd finite value like $8.7\times10^{16}$.
  • Comparing Calmar Across Sources: Both $\text{CAGR}/|\text{maxDD}|$ and $(\text{CAGR}-r_f)/|\text{maxDD}|$ are in circulation. They differ whenever $r_f \neq 0$; always state which one produced the number.
  • Returns Below $-100%$: These drive the equity curve negative, where CAGR and drawdown are undefined. Before this was guarded, a $-150%$ return produced a reported drawdown of $-151%$.

Verification

  • Submit test return series, verify tearsheet output contains Sharpe, Sortino, Calmar, and Max Drawdown.
  • Assert the seeded-curve drawdown: returns $[-0.50, +0.10, +0.05]$ must report a maximum drawdown of exactly $-0.50$.
  • Assert the Sharpe closed form: returns $[a, 0, a, 0]$ with periods_per_year=4 and $r_f=0$ give exactly $\sqrt{3}$, independent of $a$.
  • Assert the Sortino convention: returns $[0.02, 0, 0.02, -0.02]$ with periods_per_year=4 and $r_f=0$ give exactly $1.0$; dividing by the losing-period count instead would give $0.5$.
  • Cross-check maximum drawdown against a brute-force $O(n^2)$ peak-to-trough scan on real data.
  • Run python -m unittest discover -s skills/backtest-reporting-standardized-tearsheet/scripts and confirm 100% pass rate.

Related Skills

  • benchmark-relative-performance-attribution
  • paper-to-live-promotion-checklist
  • backtest-parameter-sensitivity-analysis
  • monte-carlo-strategy-robustness-testing

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 Reporting Standardized Tearsheet?

Usalo al termine di un backtest per generare una scheda standard delle prestazioni (Sharpe, Sortino, Calmar, drawdown massimo, percentuale di operazioni vincenti, profit factor) a partire da un array dei rendimenti per periodo, così da confrontare le strategie usando metriche identiche.

Perché usare Backtest Reporting Standardized Tearsheet su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Backtest Reporting Standardized Tearsheet è 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 Reporting Standardized Tearsheet in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/backtest-reporting-standardized-tearsheet. 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 Reporting Standardized Tearsheet?

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 Reporting Standardized Tearsheet?

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

La skill IA Backtest Reporting Standardized Tearsheet è 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 👇