x2strategy

Convert quantitative finance research documents into executable Backtrader trading strategies.

255|45|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/ALAGENT-HKU/x2strategy --skill x2strategy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: x2strategy
Source: https://github.com/ALAGENT-HKU/x2strategy/tree/main
Command: npx skills add https://github.com/ALAGENT-HKU/x2strategy --skill x2strategy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires litellm, backtrader, pymupdf, PyMuPDF, python-dotenv, yfinance, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill transforms quantitative finance research inputs into validated, executable trading strategies, saving time and reducing manual errors.

Core Features & Use Cases

  • Multi-Format Input: Converts PDF papers, Markdown drafts, DOCX reports, and text notes into structured strategy specifications.
  • 5-Layer LLM Extraction: Detects multi-strategy specs from any document with a 5-layer LLM approach.
  • Code Generation: Generates executable Backtrader code from the extracted specifications.
  • Automated Backtesting: Validates code and runs backtests against expected or reference outputs.
  • Agent-Native: Integrates as an Agent Skill in VS Code Copilot, Claude Code, or compatible agents.
  • Use Case: You receive a research paper with a trading strategy. Use this Skill to analyze the paper, extract the strategy, generate the code, backtest it, and diagnose the results.

Quick Start

Install the x2strategy skill in your agent and run /x2strategy followed by a PDF file to analyze the paper and generate the strategy code.

Frequently Asked Questions about x2strategy

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

FAQPage Schema
How do I convert a quantitative finance research PDF into an executable trading strategy?

You can convert a research PDF into an executable trading strategy by using a 5-layer LLM extraction approach to parse specifications and generate executable Backtrader Python code from the document.

Can I backtest trading strategies automatically from extracted research paper specifications?

Yes, you can automatically backtest trading strategies. The Skill validates generated Backtrader code and runs automated backtests against expected reference outputs to diagnose performance results.

Do I need LiteLLM and Backtrader to generate trading strategies from markdown or DOCX files?

Yes, you need LiteLLM and Backtrader along with PyMuPDF and yfinance. These dependencies are required for parsing multi-format inputs like DOCX and markdown, extracting specifications, and executing backtests.

What is the best way to automate research-to-code workflows for financial analysts?

The best way to automate research-to-code workflows is integrating an Agent Skill into VS Code Copilot or Claude Code to transform multi-format research documents into validated, executable trading strategies.

Does this approach support extracting multiple trading strategies from a single text document?

Yes, this approach supports extracting multiple trading strategies. The 5-layer LLM extraction mechanism detects multi-strategy specifications from any PDF, markdown, DOCX, or text input document.

Why does automated backtesting fail when using unstructured quantitative finance notes?

Automated backtesting may fail if unstructured notes lack clear strategy parameters. The process requires LiteLLM and PyMuPDF to properly parse documents and generate valid executable Backtrader code.