Logotipo de Backtest Reporting Standardized Tearsheet

Backtest Reporting Standardized Tearsheet

Comunidad
HimanshuJ16
backtest-reporting-standardized-tearsheet

Úsalo al final de una ejecución de backtest para generar una ficha de rendimiento estándar (Sharpe, Sortino, Calmar, drawdown máximo, tasa de aciertos, factor de beneficio) a partir de una matriz de rentabilidades por periodo, y así comparar estrategias con las mismas métricas.

Add to TypingMind

Descripción general

EditorHimanshuJ16
RepositorioAlgo-Trading-Skills
Nombre de la habilidadbacktest-reporting-standardized-tearsheet
Estrellas
50
Forks
7
Archivos incluidos
5
LicenciaApache-2.0
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Archivos incluidos: 5

    Scripts, plantillas y referencias que el modelo puede leer mientras trabaja. Los archivos son de solo lectura y nunca se ejecutan.

  • Código abierto

    Publicada por HimanshuJ16 en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Backtest Reporting Standardized Tearsheet en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/backtest-reporting-standardized-tearsheet
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese 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
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Backtest Reporting Standardized Tearsheet en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Backtest Reporting Standardized Tearsheet automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Backtest Reporting Standardized Tearsheet no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo 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

Archivos incluidos

El modelo los lee según los necesita mientras la habilidad está cargada. Son archivos de solo lectura y nunca se ejecutan.

Preguntas frecuentes

¿Qué hace la habilidad de IA Backtest Reporting Standardized Tearsheet?

Úsalo al final de una ejecución de backtest para generar una ficha de rendimiento estándar (Sharpe, Sortino, Calmar, drawdown máximo, tasa de aciertos, factor de beneficio) a partir de una matriz de rentabilidades por periodo, y así comparar estrategias con las mismas métricas.

¿Por qué usar Backtest Reporting Standardized Tearsheet en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Backtest Reporting Standardized Tearsheet está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Backtest Reporting Standardized Tearsheet en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/backtest-reporting-standardized-tearsheet. TypingMind lee el archivo SKILL.md de esa carpeta, empaqueta los archivos de la carpeta e instala el conjunto como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Backtest Reporting Standardized Tearsheet?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Backtest Reporting Standardized Tearsheet?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Backtest Reporting Standardized Tearsheet con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Backtest Reporting Standardized Tearsheet?

Sí. HimanshuJ16 la ha publicado en GitHub bajo la licencia Apache-2.0. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇