Backtestingのロゴ

Backtesting

組織
Superior-Trade
backtesting

Use when running, interpreting, or designing backtests on Superior Trade — anything about backtest windows, trade-count thresholds, exit-reason mix, parameter sweeps, walk-forward validation, zero-trade diagnosis, compute-cost estimation, or "is this backtest result trustworthy?". Pair with the relevant strategy skill, such as mean-reversion or breakout.

概要

公開者Superior-Trade
リポジトリsuperior-skills
スキル名backtesting
スター
215
フォーク
9
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

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

  • どのLLMでも利用可能

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

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

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

インストール

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

1

TypingMindにインストール

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

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

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

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

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Superior-Trade/superior-skills.git /tmp/superior-skills
mkdir -p .claude/skills
cp -r /tmp/superior-skills/skills/backtesting .claude/skills/backtesting
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

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

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

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

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

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

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

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

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

スキルの指示

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

Backtesting Best Practices

Read ../../references/unified-runtime.md for the shared API lifecycle. Submit every run with POST /runtime/backtests; creation queues it, so there is no separate start request. Use the framework and venue fields defined by GET /openapi.json and the relevant venue skill. This page is about the judgment calls — picking a window that means something, telling signal from noise in the result, and knowing when to give up vs. iterate.

The trade-count bar (sample size first)

Trade count is the single most important number on a result page. Look at it before PnL, before Sharpe, before win rate.

Trade countVerdict
< 30Coincidence, not a strategy. Don't promise anything; widen entries or extend window.
30-50Marginal. Sharpe is noisy. Treat results as directional, not numeric.
50-200Useful. Sharpe / profit factor start to mean something.
200+Statistical confidence. Now you can compare variants on micro-differences.

Watch for the trap: backtests with 5-10 trades and a 100% win rate. They look like world-beaters and almost always disintegrate live. The strategy is too selective — every signal is a coin flip you've cherry-picked, not a repeatable edge. Widen the entry threshold, lengthen the window, or accept that there's no statistical signal here.

Pick a backtest window that means something

A great backtest over the wrong window is a great fiction.

The window should answer: "if I had deployed this strategy on day one of this window, what would have happened?" — not "what's the prettiest curve I can fit?"

Cover at least one regime change

Pure bull, pure bear, sideways chop — your window should include at least two of the three. A 90-day backtest in a one-direction market is a 90-day cherry-pick. A momentum strategy that prints +50% over a +60% trending window has told you nothing about itself; it's just measured beta.

Useful default windows

  • 6 months of 1h data, or
  • 18 months of 1d data

Less than that and you're really looking at noise. More than that and Hyperliquid's history may not cover the pair (HL was launched in 2023; many alts have < 12mo of data).

When you can't get a long window

Some HIP3 / new-listing pairs only have a few weeks of data. Two pragmatic responses:

  1. Walk-forward to a similar pair. Pick a sibling perp with longer history (e.g. test the strategy on BTC if BTC-AAPL is too new), then assume the result transfers ±20%.
  2. Defer the deployment recommendation. A 14-day backtest is too thin to recommend live capital, period. Tell the user that.

Don't optimize against the test set (the cardinal sin)

If you tune parameters and validate on the same window, your backtest is a souvenir, not a forecast. This is the single most common reason strategies that look brilliant on paper die in the first week of live trading.

The honest workflow:

  1. Pick parameters from theory or a single observation, NOT from a sweep.
  2. Run the backtest.
  3. If results are bad, change the idea, not the parameters.

If you do sweep, walk forward to a different period or pair before promoting the winner. A parameter that wins on Q1 BTC and also wins on Q1 ETH (out-of-sample for the second pair) is real. A parameter that wins on Q1 BTC and gets re-validated on Q1 BTC is theatre.

Red flag

If the user's "strategy" started as a 5-variant sweep and now they want to deploy the winner — the result on the test window is overstated. Tell them to either run an out-of-sample check or accept they're deploying on optimistic numbers.

The 3-variant parameter sweep

When the user wants to find the right parameter (e.g. RSI threshold, ATR multiplier, lookback length), run 3 variants in one batch, not iterative single backtests. The shape of the 3-result table tells you what to do:

VariantConfigPnL%TradesSharpeMax DD
ARSI < 25…………
BRSI < 30…………
CRSI < 35…………

Read the shape:

  • All 3 profitable → pick the best Sharpe (not best PnL — PnL rewards luck on small samples). Parameter is robust; proceed to walk-forward / deployment with confidence.
  • 1-2 profitable → pick the winner, but flag that the param is sensitive. Either (a) walk-forward to a 2nd pair, or (b) one tighter sweep around the winner.
  • All 3 unprofitable / < 10 trades each → the idea doesn't work on this pair. Don't sweep again. Switch pair or strategy.
  • Monotonic edge (PnL strictly improves A → B → C) → the best variant is at the edge of the grid. Run one more variant past it (e.g. RSI < 40). Don't run another full 3-grid; just extend by one.

Read the exit-reason mix

After the backtest completes, look at the breakdown of how trades ended. A healthy strategy ends through a mix of:

  • Take-profit / minimal_roi
  • Signal-based exit (populate_exit_trend)
  • Trailing stop
  • Time-based timeout (custom_exit)

Each one tells a different story. Distortions diagnose specific bugs:

DistortionMeaning
90% stoploss hitsStop is too tight relative to the strategy's natural noise. Widen, or accept this strategy is in the wrong volatility regime for this pair.
90% time-based timeoutsExit signal does nothing. Either the exit conditions are too restrictive, or there's no real edge — you're just holding until the timer rings.
100% take-profit hitsminimal_roi is the strategy. The exit signal isn't earning its keep — could be removed or tightened.
50/50 stop vs profitHealthy. Strategy is choosing actively in both directions.

Zero-trade diagnosis

Zero trades from a backtest means the entry condition never fired. Five common causes, in order of likelihood:

  1. Indicator threshold too strict (e.g. RSI < 30 rarely triggers on BTC 15m).
  2. startup_candle_count larger than available data — the indicator stays NaN forever.
  3. Pair has no data for the requested timerange.
  4. Wrong pair format for trading mode (BTC/USDC for futures will silently produce no fills).
  5. Multi-condition entry that's effectively false AND false — each condition individually rare, joined by AND rarer still.

The escalation rule (don't burn cycles)

  • 1st zero-trade backtest: Diagnose. Widen the threshold, drop one of the AND conditions, or extend the window. Next attempt should be a 3-variant sweep, not a single guess — gives sensitivity in one shot.
  • 2nd consecutive all-zero result: STOP. Don't run a third. Tell the user: "Two consecutive attempts returned zero trades. The strategy needs a fundamentally different approach." Suggest a different signal (mean-reversion vs momentum, BB vs RSI), a different timeframe, or a different pair.
  • Never run 3+ all-zero attempts in a row on the same idea. Wastes compute and user trust.

Compute cost (estimate before submitting)

Backtest run time scales with candle count. Estimate before submitting so you can set the user's expectations:

candles ≈ (days × 24) / timeframe_hours × number_of_pairs
Candle countBehavior
< 100KSubmit normally, poll every 10s.
100K–500KWarn user "may take a few minutes", use exponential polling.
> 500KWarn user "could take 10+ minutes", longer poll intervals.

Reference points:

  • 1 pair × 15m × 90 days = 8.6K candles (fast)
  • 3 pairs × 5m × 90 days = 78K candles (fast)
  • 12 pairs × 1m × 90 days = 1.5M candles (slow — warn upfront)

Always allow the user to proceed. Just set expectations. Don't block on size.

Exponential polling cadence

When polling backtest_status on long runs:

  • Polls 1-3: every 10s
  • Polls 4-6: every 20s
  • Polls 7-9: every 30s
  • Polls 10+: every 60s

This prevents hitting the 20-step tool limit on million-candle backtests.

What headline numbers to trust (and not)

MetricTrust atNotes
Total tradesAlways look first.Below 30 = ignore everything else.
Total profit %Useful for ranking, weak for forecasting.Large windows + small per-trade edge can produce big PnL from luck.
Win rateOK above 50 trades.A 60% WR on 8 trades is one good week, not an edge.
Sharpe ratioAbove 1.0 = good, above 2.0 = excellent.But fragile under 50 trades; don't quote "Sharpe 2.0" off a 12-trade run.
Profit factorGross gains / gross losses. > 1.3 is the practical floor.Penalizes hidden tail losses better than Sharpe.
Max drawdown> 20% is risky for retail-sized accounts.A 5% Sharpe-1 strategy with 30% DD is unrunnable for most users.
Avg holdingSanity check — does it match the strategy's intent?A "scalp" with 12h avg holding is misnamed; a "swing" with 5min holding likewise.

Walk-forward (the honest validation)

Before recommending live deployment, run the strategy on out-of-sample data at least once:

  1. Out-of-sample period: take the most recent 30 days that weren't in your tuning window. Re-run unchanged. Numbers should be in the same ballpark — not better, not dramatically worse.
  2. Out-of-sample pair: run on a sibling pair (ETH if you tuned on BTC). Allow ±30% degradation; anything beyond that means the parameters were pair-specific not regime-specific.

If both walk-forwards survive, you have a defensible recommendation. If either falls apart, you have a backtest, not a strategy.

よくある質問

AIスキル「Backtesting」では何ができますか?

Use when running, interpreting, or designing backtests on Superior Trade — anything about backtest windows, trade-count thresholds, exit-reason mix, parameter sweeps, walk-forward validation, zero-trade diagnosis, compute-cost estimation, or "is this backtest result trustworthy?". Pair with the relevant strategy skill, such as mean-reversion or breakout.

TypingMindでBacktestingを使うメリットは何ですか?

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

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

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/Superior-Trade/superior-skills/tree/main/skills/backtestingを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Backtestingを使えるAIモデルはどれですか?

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

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

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

AIスキル「Backtesting」は無料ですか?

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

AIスキルとは何ですか?

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

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

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

すべて見る

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

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