backtest_engine

Backtest quantitative trading strategies on historical financial data with performance metrics.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/benitorhuang-svg/tw-stock-app --skill backtest-engine
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backtest_engine
Source: https://github.com/benitorhuang-svg/tw-stock-app/tree/main/.agents/skills/backtest_engine
Command: npx skills add https://github.com/benitorhuang-svg/tw-stock-app --skill backtest-engine

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a robust framework for validating quantitative trading strategies through historical data, ensuring they meet strict performance and risk criteria before deployment.

Core Features & Use Cases

  • Event-Driven Backtesting: Simulates trading scenarios bar-by-bar using historical price, indicator, and fundamental data.
  • Performance Metrics: Calculates key metrics like win rate, Sharpe ratio, and maximum drawdown.
  • Anti-Cheating Rules: Enforces rules against lookahead bias, survivorship bias, and improper cost modeling.
  • Use Case: A quantitative analyst can use this Skill to test a new mean-reversion strategy against 10 years of market data, verifying its profitability and risk profile against predefined thresholds.

Quick Start

Use the backtest_engine skill to run a backtest for the 'foreign_3buy_t5' strategy on the '2020-01-01' to '2023-12-31' date range.

Frequently Asked Questions about backtest_engine

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

FAQPage Schema
How do I backtest a quantitative trading strategy against historical financial data?

You can backtest a trading strategy by simulating trades bar-by-bar using historical price and fundamental data. The engine processes your predefined rules to calculate performance metrics like win rate and maximum drawdown.

What is lookahead bias in backtesting and how is it prevented?

Lookahead bias in backtesting occurs when a strategy uses future data unavailable at the time of a trade. This engine enforces anti-cheating rules to prevent lookahead bias, survivorship bias, and improper cost modeling.

Can I use technical, fundamental, and institutional data inputs for strategy validation?

Yes, the backtesting engine supports technical, fundamental, and institutional data inputs. It simulates trading scenarios using these data types to validate your quantitative strategies against historical market conditions.

What performance metrics are calculated when simulating trades with historical data?

Simulating trades calculates key performance indicators including win rate, Sharpe ratio, and maximum drawdown. These metrics help you evaluate the profitability and risk profile of your trading strategy before deployment.

Does this backtesting engine handle cost modeling and risk management?

Yes, the engine enforces proper cost modeling and calculates risk management metrics. It ensures your backtesting results reflect realistic trading conditions by accounting for transaction costs and risk exposure.

What are the limitations of using an event-driven backtesting approach?

Event-driven backtesting simulates scenarios bar-by-bar, which provides accuracy but may require significant processing time for large historical datasets. Results are also constrained by the quality of historical financial data inputs.