Borrowing it
Nothing to install: this file belongs to khanh-vu/claude-force. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/khanh-vu/claude-force/main/.claude/skills/crypto-backtesting/SKILL.mdgit clone --depth 1 https://github.com/khanh-vu/claude-forceWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/khanh-vu/claude-force/crypto-backtesting)<a href="https://agentmods.dev/skills/khanh-vu/claude-force/crypto-backtesting"><img src="https://agentmods.dev/badge/skills/khanh-vu/claude-force/crypto-backtesting/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/khanh-vu/claude-force/crypto-backtesting"><img src="https://agentmods.dev/badge/skills/khanh-vu/claude-force/crypto-backtesting.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00761 |
| Opus 5.5 | $0.00000 | $0.00304 |
| Sonnet 5.5 | $0.00000 | $0.00152 |
| Haiku 4.5 | $0.00000 | $0.00076 |
Grade A, and why
crypto-backtesting scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 112 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Crypto Backtesting
Comprehensive backtesting framework patterns and pitfalls to avoid.
Backtesting Engine
import pandas as pd
from dataclasses import dataclass
@dataclass
class BacktestResult:
total_return: float
sharpe_ratio: float
max_drawdown: float
win_rate: float
num_trades: int
class Backtester:
def __init__(self, strategy, data: pd.DataFrame, initial_capital: float = 10000):
self.strategy = strategy
self.data = data
self.initial_capital = initial_capital
self.portfolio_value = []
self.trades = []
def run(self) -> BacktestResult:
"""Execute backtest with proper order of operations"""
capital = self.initial_capital
position = 0
for timestamp, row in self.data.iterrows():
# Generate signal BEFORE knowing close price (avoid lookahead bias)
signal = self.strategy.generate_signal(row, position)
if signal == 'buy' and position == 0:
# Use NEXT bar's open price (realistic execution)
entry_price = self._get_next_open(timestamp)
shares = capital / entry_price
position = shares
capital = 0
self.trades.append(('buy', timestamp, entry_price, shares))
elif signal == 'sell' and position > 0:
exit_price = self._get_next_open(timestamp)
capital = position * exit_price
self.trades.append(('sell', timestamp, exit_price, position))
position = 0
# Track portfolio value
current_value = capital + (position * row['close'])
self.portfolio_value.append(current_value)
return self._calculate_metrics()
Walk-Forward Analysis
def walk_forward_optimization(
strategy_class,
data: pd.DataFrame,
train_window: int = 252, # 1 year
test_window: int = 63, # 3 months
step_size: int = 21 # 1 month
):
"""
Walk-forward optimization to prevent overfitting
Train on historical data, test on future data
"""
results = []
for i in range(0, len(data) - train_window - test_window, step_size):
# Split data
train_data = data.iloc[i:i+train_window]
test_data = data.iloc[i+train_window:i+train_window+test_window]
# Optimize on training data
best_params = optimize_strategy(strategy_class, train_data)
# Test on out-of-sample data
strategy = strategy_class(**best_params)
backtest = Backtester(strategy, test_data)
result = backtest.run()
results.append({
'train_period': (train_data.index[0], train_data.index[-1]),
'test_period': (test_data.index[0], test_data.index[-1]),
'params': best_params,
'result': result
})
return results
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 112 lines · 0 tokens per session scan A 3ddf2001a422
crypto-backtesting is a skill published in the GitHub repository khanh-vu/claude-force (6 stars, last pushed 11mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 761 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
strategy-generate
Create, modify, and optimize quantitative trading strategies, then backtest and evaluate them.
health
Audits agent config, instruction drift, hooks or MCP, and AI maintainability. Use when Claude, Codex, or Pi setup looks wrong. Not for application bugs or PR review.
mt5-robot-tester
Select the best MetaTrader 5 trading robots (Expert Advisors) that have not been backtested yet, by running the MT5 Strategy Tester from the command line through a 3-round pipeline. Use when the user wants to batch-test MT5 bots/EAs, screen robots across all symbols, optimize EA parameters, or move candidate bots to…
paymentsim
Run billing against paymentsim, haven's Stripe stand-in: checkout, subscriptions, invoices, signed webhooks, the test clock, payment failures and exact metered-usage totals. Use when someone says 'haven payment', 'test billing locally', 'fake Stripe', 'stripe webhook locally', 'advance the billing clock', 'fail a…
prompt-proximity-architecture
Turn an approved measurement charter, ICPs, and buyer jobs into a budget-aware prompt coverage blueprint across proximity bands, aided status, information acts, journey states, roles, locales, evidence grades, partitions, and measurement lanes. Use before prompt wording to define required, optional, and prohibited…
backtesting-frameworks
Build robust backtesting systems for trading strategies with proper handling of look-ahead bias, survivorship bias, and transaction costs. Use when developing trading algorithms, validating strategies, or building backtesting infrastructure.