Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/khanh-vu/claude-force/crypto-backtestingnpx skills add khanh-vu/claude-force --skill crypto-backtestinggit 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.svg" alt="Measured on agentmods" 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 | $0.00000 | $0.00380 |
| Sonnet 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 5d 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.
- 5d 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 (5 stars, last pushed 9mo 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
sector-rotation
行业轮动分析——申万行业景气度评分、行业动量排名、产业链传导、估值/盈利/资金流多维比较框架.
strategy-pivot-designer
Detect backtest iteration stagnation and generate structurally different strategy pivot proposals when parameter tuning reaches a local optimum.
twitter-reader
Read Twitter/X for financial research using opencli (read-only). Use this skill whenever the user wants to read their Twitter feed, search for financial tweets, view bookmarks, look up user profiles, or gather market sentiment from Twitter/X. Triggers include: "check my feed", "search Twitter for", "show my…
chenhao-limit-up
Use when evaluating A-share limit-up (涨停板) setups through Chen Hao's sentiment and momentum lens: market emotion cycles, board strength, follow-through, and short-term aggressive momentum trading.
trading-risk-gate
Unified pre-trade safety gate: Ruin check (Law #1), ergodicity audit, and win-rate dominance validation. Absorbs: ergodicity-check, law-of-ruin, win-rate-dominance.
vectorbt
High-performance vectorized backtesting with parameter optimization, portfolio simulation, and rich performance metrics.