strategy-generate

Generate and backtest quantitative trading strategies with config.json and SignalEngine code.

Updated May 5, 2026
One-click install
npx skills add https://github.com/wudye/traderAssistHK --skill strategy-generate-wudye
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: strategy-generate
Source: https://github.com/wudye/traderAssistHK/tree/main/backend/src/skills/strategy-generate
Command: npx skills add https://github.com/wudye/traderAssistHK --skill strategy-generate-wudye

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill turns vague trading ideas into a runnable quantitative strategy by generating the required configuration and strategy signal code, then guiding users through backtest-driven iteration so they can improve results.

Core Features & Use Cases

  • Requirements parsing to configuration: converts user intent into a config.json specifying instruments, dates, and execution/backtest settings.
  • Signal engine code generation: produces a code/signal_engine.py implementation that follows the SignalEngine contract and outputs position signals in the required range.
  • Backtest evaluation workflow: runs the engine’s built-in backtest process and evaluates artifacts like artifacts/metrics.csv and artifacts/equity.csv against clear gates (e.g., metrics existence, non-empty equity, non-NaN equity, and trade count).
  • Multi-market support: supports China A-shares, US stocks, Hong Kong stocks, and cryptocurrencies with consistent code normalization rules and an auto-routing source strategy.

Quick Start

Use the strategy-generate skill to build a 5-day vs 20-day dual moving-average crossover strategy for 000001.SZ, and backtest it for 2024.

Frequently Asked Questions about strategy-generate

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

FAQPage Schema
How do I generate and backtest a quantitative trading strategy from a natural language idea?▼

To generate and backtest a quantitative trading strategy, this Skill converts your requirements into a config.json and SignalEngine-compatible pandas/numpy signal code, then runs an iterative backtest to produce performance metrics and equity artifacts.

Can I backtest trading strategies for both cryptocurrencies and equities using the same engine?▼

Yes, you can backtest trading strategies across China A-shares, US stocks, Hong Kong stocks, and cryptocurrencies, as the engine applies consistent code normalization and an auto-routing source strategy for multi-market support.

How does signal generation handle position sizing and index alignment for portfolio allocation?▼

Signal generation requires deterministic pure pandas/numpy implementations to output position signals with strict index alignment, ensuring accurate entry/exit logic and portfolio allocation within the generated SignalEngine contract.

What are the evaluation gates for validating backtest artifacts like metrics and equity curves?▼

Backtest evaluation validates generated artifacts by checking for metrics.csv and equity.csv existence, non-empty and non-NaN equity values, and confirming at least one trade was executed to ensure non-empty performance metrics.

What is the best way to iterate on a dual moving-average crossover strategy after an initial backtest?▼

The best way to iterate on a dual moving-average crossover strategy is through artifact-based assessment, modifying the generated signal code and config.json based on evaluated performance metrics and equity artifacts to improve backtest results.