# Strategy Generate

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

- Repository: https://github.com/HKUDS/Vibe-Trading (37375 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add HKUDS/Vibe-Trading --skill strategy-generate -g -a claude-code -y`
Codex: `npx skills add HKUDS/Vibe-Trading --skill strategy-generate -g -a codex -y`
Cursor: `npx skills add HKUDS/Vibe-Trading --skill strategy-generate -g -a cursor -y`
Gemini CLI: `npx skills add HKUDS/Vibe-Trading --skill strategy-generate -g -a gemini-cli -y`

## Description

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

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

## Workflow

1. **Requirements parsing**: parse user intent, extract instrument codes, time range, and strategy logic, then write `config.json`
2. **Strategy design**: think through the 5 questions of data / signal / position sizing / backtest / validation
3. **Strategy coding**: write `code/signal_engine.py` (following the `SignalEngine` contract)
4. **Syntax check**: `bash("python -c \"import ast; ast.parse(open('code/signal_engine.py').read()); print('OK')\"")`
5. **Run backtest**: call the `backtest` tool (built into the engine; no need to write `run_backtest.py`)
6. **Evaluate results**: use the backtest tool's structured metrics, validation and artifact summary. Read `artifacts/metrics.csv` or targeted rows with `read_run_artifact` only when the requested evidence is missing from that summary. Judge by the review criteria and report failures honestly.
7. **Fix implementation errors**: repair code/contract errors and rerun to verify. Poor returns in a correctly implemented strategy are a valid result: report them and stop. Change the strategy or test additional candidates only when the user requested optimization or comparison, within their specified scope. Deeper attribution and robustness research are performed when requested, not added to every backtest.

**You only need to write `signal_engine.py` and `config.json`. The `backtest` tool automatically handles data loading and backtest execution.**

## Adapting a registered strategy

The rest: https://github.com/HKUDS/Vibe-Trading/blob/HEAD/agent/src/skills/strategy-generate/SKILL.md
