Backtest Reporting Standardized Tearsheetのロゴ

Backtest Reporting Standardized Tearsheet

コミュニティ
HimanshuJ16
backtest-reporting-standardized-tearsheet

バックテストの実行終了時に使用し、期間ごとのリターン配列から、シャープレシオ、ソルティノレシオ、カルマーレシオ、最大ドローダウン、勝率、プロフィットファクターをまとめた標準的なパフォーマンスシートを作成します。戦略を同一の指標で比較できます。

Add to TypingMind

概要

公開者HimanshuJ16
リポジトリAlgo-Trading-Skills
スキル名backtest-reporting-standardized-tearsheet
スター
50
フォーク
7
同梱ファイル
5
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 5個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    HimanshuJ16がGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Backtest Reporting Standardized Tearsheet」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/backtest-reporting-standardized-tearsheet
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでBacktest Reporting Standardized Tearsheetを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にBacktest Reporting Standardized Tearsheetを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Backtest Reporting Standardized Tearsheetは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Backtest Reporting Standardized Tearsheet」では何ができますか?

バックテストの実行終了時に使用し、期間ごとのリターン配列から、シャープレシオ、ソルティノレシオ、カルマーレシオ、最大ドローダウン、勝率、プロフィットファクターをまとめた標準的なパフォーマンスシートを作成します。戦略を同一の指標で比較できます。

TypingMindでBacktest Reporting Standardized Tearsheetを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Backtest Reporting Standardized Tearsheetはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにBacktest Reporting Standardized Tearsheetをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/backtest-reporting-standardized-tearsheetを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Backtest Reporting Standardized Tearsheetを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Backtest Reporting Standardized Tearsheetで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもBacktest Reporting Standardized Tearsheetを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Backtest Reporting Standardized Tearsheet」は無料ですか?

はい。HimanshuJ16がApache-2.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇