claude-force: Skill for Claude Code

.claude/skills/crypto-backtesting/SKILL.md

crypto-backtesting is a skill for Claude Code from khanh-vu/claude-force. It costs 0 tokens per session (761 once invoked), scanned A, original, MIT.

Patterns for testing cryptocurrency trading strategies against historical market data, a process called backtesting.

In plain words
What is it for?
Use it to model trades, calculate returns, risk and drawdowns, and account for realistic order timing.
Why use it?
It helps reveal misleading results caused by using future information or unrealistic trade prices.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is khanh-vu/claude-force's own configuration. It tells Claude Code how to work on claude-force itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-force configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/khanh-vu/claude-force/main/.claude/skills/crypto-backtesting/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/khanh-vu/claude-force

Made for: Claude Code.

Wrote 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.

agentmods badge for crypto-backtesting

README.md
[![agentmods](https://agentmods.dev/badge/skills/khanh-vu/claude-force/crypto-backtesting/github.svg)](https://agentmods.dev/skills/khanh-vu/claude-force/crypto-backtesting)
Your own site
<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.

agentmods 80×15 button for crypto-backtesting

Your own site · 80×15
<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>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 761 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 2mo ago against content hash 3ddf2001a422, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

.claude/skills/crypto-backtesting/SKILL.md · 112 lines

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

Read the full file on GitHub · 112 lines

Changes

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.

  1. 2mo ago First seen · 112 lines · 0 tokens per session scan A 3ddf2001a422

Subscribe to this mod's changes

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.

Related

Other skills, from other repositories

strategy-generate

Create, modify, and optimize quantitative trading strategies, then backtest and evaluate them.

HKUDS/Vibe-Trading · 21 tokens

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.

tw93/Waza · 40 tokens

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…

tradermonty/claude-trading-skills · 111 tokens

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…

langwatch/langwatch · 110 tokens

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…

elvisun/newsjack · 67 tokens

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.

rmyndharis/antigravity-skills · 45 tokens