backtesting-sim

Backtest trading strategies on OHLCV data and compute performance metrics.

10|2|Updated Mar 8, 2026
One-click install
npx skills add https://github.com/mahmoud20138/Tradecraft --skill backtesting-sim
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backtesting-sim
Source: https://github.com/mahmoud20138/Tradecraft/tree/main/plugins/tradecraft/skills/backtesting-sim
Command: npx skills add https://github.com/mahmoud20138/Tradecraft --skill backtesting-sim

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a fast, reproducible framework for evaluating trading ideas by performing vectorized backtesting, generating comprehensive performance metrics, and enabling robust validation.

Core Features & Use Cases

  • Vectorized backtesting: fast, scalable evaluation of signals against OHLCV data with costs and slippage.
  • Performance metrics: automatic computation of Sharpe, Sortino, Calmar, max drawdown, win rate, and more.
  • Walk-forward validation: anchored out-of-sample testing to assess robustness across regimes.
  • Strategy comparison: compare multiple strategies on a common dataset to identify the best performers.
  • Use cases include evaluating new indicators, testing rule changes, and stress-testing strategies over historical data.

Quick Start

Prepare your OHLCV data with a signal column and run the backtester to obtain full results.

Frequently Asked Questions about backtesting-sim

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I calculate trading strategy performance metrics like Sharpe and drawdown from historical data?

To calculate trading strategy performance metrics, you need a framework that processes OHLCV data and signal columns to output measures like Sharpe ratio, max drawdown, and win rate. This approach automates the quantitative analysis for strategy validation.

What is vectorized backtesting and how does it handle multiple market regimes?

Vectorized backtesting is a fast, scalable method for evaluating trading signals against historical OHLCV data. It applies vectorized operations across multiple market regimes to generate comprehensive performance metrics and enable robust strategy validation.

How do I run walk-forward validation on trading strategies using OHLCV data?

To run walk-forward validation on trading strategies, you apply anchored out-of-sample testing to your OHLCV data. This process assesses strategy robustness across various historical regimes and outputs performance metrics to identify potential weaknesses.

Can I use this backtesting framework to compare multiple trading strategies on a common dataset?

Yes, you can use this backtesting framework to compare multiple trading strategies on a common dataset. It evaluates rule changes and new indicators against historical data, allowing you to identify the best performers based on computed metrics.

Do I need a specific DataFrame structure to simulate trading strategies and include transaction costs?

You need a DataFrame containing OHLCV columns and a signal column to simulate trading strategies. The vectorized backtesting process incorporates transaction costs and slippage into the performance analysis to ensure realistic strategy validation.

What is the best way to stress-test quantitative trading strategies over historical data?

The best way to stress-test quantitative trading strategies is using a reproducible framework that applies vectorized backtesting over historical data. This approach generates performance metrics like Calmar and Sortino to evaluate strategy robustness under various conditions.