Agent skill

Trading Strategy Generator

by HKUDS in HKUDS/Vibe-Trading

Takes a trading idea from request to backtest: pins down instruments and dates, writes config.json and a signal engine, runs the backtest and iterates on the metrics.

MITAuto-check passedBusiness, Finance & HR

Install Trading Strategy Generator

skills CLI
$ npx skills add HKUDS/Vibe-Trading --skill strategy-generate -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install HKUDS/Vibe-Trading strategy-generate --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/HKUDS/Vibe-Trading.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agent/src/skills/strategy-generate .claude/skills/strategy-generate && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
strategy-generate
GitHub stars
35k
Token cost
~4.2k tokens
SKILL.md length
2,007 words
Files
2
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

Takes a trading idea from request to backtest: pins down instruments and dates, writes config.json and a signal engine, runs the backtest and iterates on the metrics.

  • Works in 7 steps: Requirements parsing: parse user intent,… → Strategy design: think through the 5… → Strategy coding: write… → …
  • Turning a trading idea into a coded and backtested strategy
  • SKILL.md covers Workflow, Requirements Parsing, Strategy Design and SignalEngine Contract, plus 8 more sections
  • Calls python

What it does

The skill walks an agent through building a quantitative trading strategy in seven steps: parse the request into instrument codes, time range and logic, design the strategy around five questions, code it, check the syntax, run the backtest, evaluate the results and fix what is weak. The agent only writes `config.json` and `code/signal_engine.py`, which must follow the `SignalEngine` contract, while the built-in `backtest` tool handles data loading and execution.

When no dates are given, the window defaults to 10 years back from today. Indicators with long lookbacks need earlier bars, so the start date moves back and the boundary is declared with `warmup_bars`; otherwise the extra bars are scored too. If the instrument, strategy or market is unclear, the agent is told to ask you instead of guessing. Results are read from `artifacts/metrics.csv`, and an `examples.md` file ships with the skill. The excerpt is cut off before the design questions.

When your agent uses it

  • Turning a trading idea into a coded and backtested strategy
  • Improving an existing strategy whose backtest results are weak
  • Setting up a backtest with the right date range and indicator warm-up
  • Evaluating a strategy's metrics file against review criteria

Example prompts

  • “Build a moving-average crossover strategy for AAPL and backtest it over the default window.”
  • “My RSI strategy underperforms, so modify it and rerun the backtest to see if it improves.”
  • “Backtest a 252-day z-score mean-reversion strategy on ETH and handle the warm-up bars correctly.”

Requirements

  • A backtest engine that provides the `backtest` tool
  • Python for writing `signal_engine.py`

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  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: read artifacts/metrics.csv and judge by the review criteria
  7. Iterative fixing: if results are poor, modify with edit_file → run backtest → re-evaluate

What it can do on your machine

Read from SKILL.md and the folder at commit e532650. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Trading Strategy Generator loads about 4.2k tokens when it runs. Until then it costs about 28 tokens; SKILL.md has 2,007 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~28
When it runs · the whole SKILL.md, loaded when a task matches
~4.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from HKUDS/Vibe-Trading at commit e532650, republished under its MIT licence (© HKUDS). 2,007 words, ~4,220 tokens.

Download SKILL.mdSave it as .claude/skills/strategy-generate/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
strategy-generate
description
Create, modify, and optimize quantitative trading strategies, then backtest and evaluate them.
category
strategy

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: read artifacts/metrics.csv and judge by the review criteria
  7. Iterative fixing: if results are poor, modify with edit_file → run backtest → re-evaluate

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

Requirements Parsing

Extract the following from the user's description:

  • Instrument codes: process them according to the normalization rules below
  • Time range: if the user does not specify dates, default to 10 years back from today (for example, if today is 2026-03-18, then start_date=2016-03-18, end_date=2026-03-18)
  • Indicator warm-up: a long lookback (MA200, a 252-day z-score) needs bars from before the requested period. Move start_date back to load them and declare the boundary with warmup_bars — the requested period is what gets graded, and undeclared warm-up bars are graded too. Silently backdating start_date by a year turns a 10-year backtest into an 11-year one that still calls itself 10 years: the extra year's trades, CAGR and benchmark all enter the report, the run succeeds, and the numbers look internally consistent
  • Strategy logic: entry / exit conditions and indicator parameters

If critical information is missing, you must ask the user instead of guessing:

  • Instrument not specified → ask which instrument they want to backtest (offer several popular suggestions)
  • Strategy description is vague (for example, "help me build a strategy") → provide 2-3 strategy directions for the user to choose from
  • Mixed markets but not clearly specified → confirm the data source

Write config.json first, then write code. config.json must be placed in the root of run_dir.

Strategy Design

Before writing code, think through these 5 questions:

  1. Data requirements: what fields are needed (basic OHLCV only, daily valuation fields such as pe/pb/roe, or statement fields such as income_total_revenue / fina_indicator_roe?), data frequency (daily), and market (which determines the data source)
  2. Signal logic: what are the entry conditions? What are the exit conditions? Direction (long / short / long-short)? Are there filters (volume, trend confirmation, and so on)?
  3. Position management: equal-weight allocation or scaling in/out? Risk control (stop-loss, maximum position)? In portfolio strategies, once top N names are selected, each weight = 1/N
  4. Backtest parameters: time range, initial capital (default 1,000,000), commission (default 0.1%)
  5. Validation checklist: signal consistency (no NaN signals), position check (normalized to prevent leverage), and completeness of generated artifacts

There is no need to output a JSON design document. Express these design decisions directly in code.

SignalEngine Contract

python
class SignalEngine:
    def generate(self, data_map: Dict[str, pd.DataFrame]) -> Dict[str, pd.Series]:
        """
        Args:
            data_map: code -> DataFrame (columns: open, high, low, close, volume, DatetimeIndex)
                     If config.extra_fields is specified, pe, pb, roe, and similar daily_basic columns will also be present.
                     If config.fundamental_fields is specified, PIT-safe statement columns such as
                     income_total_revenue, income_n_income, and fina_indicator_roe will also be present.
        Returns:
            code -> signal Series, value range [-1.0, 1.0]
            1.0 = fully long, 0.5 = half position, 0.0 = flat, -1.0 = fully short
            Portfolio strategy: selected stocks split weights equally (for example top 10 -> each 0.1)
            Legacy integer signals {-1, 0, 1} remain compatible (treated as -100% / 0% / 100%)
        """

Hard constraints:

  • The signal Series index must align exactly with the input DataFrame index
  • Include all required imports (numpy, pandas, and so on)
  • Do not hardcode dates or stock codes (read them from config.json)
  • Do not include an if __name__ == "__main__" block
  • Pure pandas / numpy implementation, with no external signal libraries
  • Output plain Python code, not Markdown fences

Quality Checklist

Self-check after writing signal_engine.py:

  • All imports are included (numpy, pandas, typing, and so on)
  • No undefined variables
  • Signal logic is consistent with the strategy description
  • Boundary handling: for empty data or insufficient history before the lookback window, use fillna(0) or skip
  • Portfolio strategy: once N stocks are selected, each weight = 1/N (for example top 10 → each 0.1), unselected names = 0
  • Signal values stay within [-1.0, 1.0]

Instrument Code Normalization

  • 6-digit China A-share codes → automatically append suffix: codes starting with 600/601/603 → .SH, all others → .SZ
  • US stocks: uppercase letters + .US, such as AAPL.US (yfinance converts automatically)
  • Hong Kong stocks: digits + .HK, such as 700.HK (yfinance converts automatically)
  • Canadian stocks: Yahoo ticker + .TO for TSX or .V for TSXV, such as TD.TO or PNG.V
  • Cryptocurrencies: BTC-USDT format (OKX spot pairs, must use the hyphen -, not slash /)
    • The user may write BTC/USDT, but config.json must use "BTC-USDT"

Cryptocurrency Notes

  • Code format: must be XXX-USDT (uppercase + hyphen), such as BTC-USDT and ETH-USDT
  • source: must be set to "okx"
  • extra_fields: must be null (OKX does not support fundamentals)
  • Data format: DataLoader has already normalized the output to match China A-shares exactly: open, high, low, close, volume + DatetimeIndex
  • No special handling needed in strategy code: signal_engine.py should be written the same way as for China A-shares; do not add extra data conversion for OKX

Market Detection and Data Sources

PatternMarketsourceExtra Fields
^\d{6}\.(SZ|SH|BJ)$China A-sharestushareextra_fields: pe, pb, pe_ttm, ps_ttm, dv_ttm, total_mv, circ_mv, roe; fundamental_fields: income/balancesheet/cashflow/fina_indicator
^[A-Z]+\.US$US stocksyfinance-
^\d{3,5}\.HK$Hong Kong stocksyfinance-
^[A-Z0-9&.-]+\.(TO|V)$Canadian stocks (TSX / TSXV)yahoo / yfinance-
^[A-Z]+-USDT$Cryptocurrencyokx-

extra_fields selection logic: only China A-shares (tushare) support daily valuation fields. If the strategy needs PE/PB/ROE and similar daily_basic fields, specify them in config.json.extra_fields and DataLoader will retrieve them automatically. Hong Kong, US, Canadian stocks, and crypto do not support extra_fields.

fundamental_fields selection logic: use this for China A-share financial statement pre-filters. The runner queries income, balancesheet, cashflow, and/or fina_indicator through the Tushare fundamental provider, then merges rows into daily bars only after their announcement/disclosure date. Output columns are prefixed by table name, for example income_total_revenue, income_n_income, balancesheet_total_hldr_eqy_exc_min_int, and fina_indicator_roe. Daily frames only: an announcement date carries no time of day, so on an intraday frame a filing would be visible from the first bar of its own announcement day. A sub-daily interval plus fundamental_fields is rejected outright; set "fundamental_subdaily": "next_day" to run it anyway under the conservative rule that day D's announcement becomes visible at the first bar of D+1.

Show full SKILL.md (1,087 more words)Show less

config.json Format

json
{
  "source": "auto",
  "codes": ["000001.SZ"],
  "start_date": "2016-03-18",
  "end_date": "2026-03-18",
  "warmup_bars": 0,
  "interval": "1D",
  "initial_cash": 1000000,
  "commission": 0.001,
  "extra_fields": null,
  "fundamental_fields": null,
  "optimizer": null,
  "optimizer_params": {},
  "engine": "daily",
  "position_adjustment": "rebalance",
  "rebalance_mask": null,
  "rebalance_tolerance": 0.05,
  "validation": null
}
  • source: "auto" (recommended, auto-select by code format) / "tushare" / "yfinance" / "okx" / "akshare" / "ccxt"
    • "auto" supports mixed instruments. For example, ["000001.SZ", "BTC-USDT"] will be automatically routed to tushare and okx
    • Futures codes (e.g. "IF2406.CFFEX", "ESZ4") and forex pairs (e.g. "EUR/USD") are also auto-routed
  • interval: candlestick interval, default "1D". Supported values: "1m" / "5m" / "15m" / "30m" / "1H" / "4H" / "1D" / "1W" / "1M" (weekly and monthly bars are built from daily ones; "1M" is a month, "1m" a minute)
    • The annualization factor for minute backtests is inferred automatically from source (252 trading days for China A-shares, 365 calendar days for crypto)
    • Minute backtests can be very data-heavy. Recommended limits are no more than 30 days for 1m, or 1 year for 1H
  • warmup_bars: how many leading bars exist only to prime the indicators. They are loaded and fed to SignalEngine.generate(), then excluded from trades, the equity curve, the benchmark and every metric. Default 0 grades the whole loaded window.
    • Use it whenever you widen start_date for an indicator's lookback. start_date is the data window; start_date plus warmup_bars is the evaluation window, and the report describes the second one.
    • Size it from the longest lookback in the strategy, plus a margin: MA200 needs at least 200 daily bars, a 252-day rolling z-score needs 252. Then set start_date far enough back to supply them.
    • evaluation_start_date ("YYYY-MM-DD") is the same instruction stated as a date, for when the user names the period rather than the lookback. Declare one or the other — declaring both is rejected.
  • extra_fields: China A-shares can use values such as ["pe", "pb", "roe"]; other markets should use null
  • fundamental_fields: optional China A-share statement fields, such as {"income": ["total_revenue", "n_income"], "fina_indicator": ["roe"]}; use null unless the strategy needs financial statement pre-filtering
  • optimizer: optional, one of "equal_volatility" / "risk_parity" / "mean_variance" / "max_diversification" / "turnover_aware" / null (equal-weight by default)
  • optimizer_params: optimizer parameters, such as {"lookback": 60}. mean_variance additionally supports {"risk_free": 0.0}; turnover_aware supports {"risk_aversion": 1.0, "turnover_penalty": 0.5} (L1 penalty on weight changes; tune to data frequency)
  • engine: backtest engine, default "daily". For options strategies, set "options" (requires OptionsSignalEngine)
  • position_adjustment: always state this explicitly — the two modes produce different books from the same signals, and neither is right for every strategy.
    • "rebalance" executes every target change with market fills and weighted-average entry accounting. It also re-sizes whenever the held weight has drifted from the target, and a strategy restates its target on every bar, so a constant target means a fill on every bar: measured on a 40-bar rising series, a constant 20% target produced 40 fills instead of 1, with the fees, slippage and transaction taxes that follow. Use rebalance_mask when the strategy has its own execution cadence.
    • "hold" keeps a same-direction position until it exits or reverses, so the weight drifts with price and a requested resize is not executed. Dropped requests are counted in the report as dropped_target_adjustment_count, with the first twenty listed, so a rebalance count that does not match the trade log is explained rather than silent.
    • Rule of thumb: "rebalance" when the target weight itself carries the strategy (optimizers, risk budgets, continuous scaling); "hold" when entries and exits carry it and the weight in between is incidental.
  • rebalance_mask: optional execution schedule used only under "rebalance". Use a pandas offset alias such as "MS", "W-FRI", or "QS", or an explicit ISO-date list such as ["2026-01-02", "2026-02-02"]. Each period/date selects the first aligned trading bar on or after it; ordinary bars HOLD even when the dense target is zero. An alias must not be finer than the aligned bar interval; W-FRI starts a Friday-anchored period and normally executes on the following Monday. Omit it to preserve every-bar execution. Do not combine it with "hold".
  • rebalance_tolerance: drift band around the target, as a fraction of it, used only under "rebalance". A resize executes once the held weight has moved further than this from its target; a changed target breaches any sane band on its own, so target changes always execute. Default 0.0 means no band, and then the resize test is decided by the slippage width alone — measured on a constant 20% target over 60 bars, 0.0 produced 60 fills, 0.02 produced 12, and 0.05 produced 5 while the weight never left 0.21. Use rebalance_mask, not tolerance, to express a strategy's execution cadence. 0.05 is a reasonable starting point, not a recommendation with evidence behind it — it is your modelling choice and the report records the value the run used.
  • initial_cash: default 1,000,000
  • commission: default 0.1%
  • validation: optional statistical validation after backtest completes. Omit to skip. Example:
    json
    "validation": {
      "monte_carlo": {"n_simulations": 1000},
      "bootstrap": {"n_bootstrap": 1000, "confidence": 0.95},
      "walk_forward": {"n_windows": 5}
    }
    • monte_carlo: permutation test — shuffles trade order to compute p-value (is Sharpe significantly better than random?)
    • bootstrap: resamples daily returns to compute Sharpe 95% confidence interval
    • walk_forward: splits equity curve into N windows, checks performance consistency
    • Each key is optional — include only the validations you want
    • Can also run standalone on past results: python -m backtest.validation <run_dir>

Review Criteria

Hard Gates (any failure → passed=false)
  1. artifacts/metrics.csv exists and is non-empty
  2. artifacts/equity.csv exists and is non-empty
  3. exit_code == 0 (backtest exits normally)
  4. The equity column in equity.csv contains no NaN values
  5. trade_count > 0 (zero trades = signal bug)
Scoring Rules
  • Successful backtest + complete artifacts + at least 1 trade → score ≥ 60 → passed
  • Poor return / low Sharpe alone should not push the score below 60; they are optimization suggestions only
  • score ≥ 60 = passed=true
Bug Categories (reduce the score)
  1. Zero trades (trade_count=0): signal-logic bug, conditions may be too strict
  2. Late first trade (first trade > 2 years after backtest start): data-filtering bug or overly long lookback window
  3. Capital utilization < 50%: position-management bug, portfolio is flat most of the time
  4. Open position at the end (positions still open when backtest ends): exit-signal timing bug
action_items Format

If improvements are needed after evaluation, write action_items:

  • Format: "Change X from A to B" or "Add X logic in signal_engine.py"
  • Must be specific down to parameter values, file names, and function names
  • At least 2 items
  • Examples:
    • "Change short MA from 5 to 10 days to reduce whipsaw signals"
    • "Add stop-loss: force close when loss exceeds 5%"
    • "Add volume filter in signal_engine.py: only trigger buy on high volume"

Cross-Market Strategies

When the user requests a backtest with codes from different markets (e.g. ["000001.SZ", "BTC-USDT"]):

  • Set source: "auto" in config.json
  • The CompositeEngine handles calendar alignment, shared capital, and per-market rules automatically
  • Use volatility-adjusted weights so high-vol assets (crypto) don't dominate the risk budget
  • See the cross-market-strategy skill for per-market parameters, vol-adjustment, and example code

Supporting Files

© HKUDS, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in agent/src/skills/strategy-generate of HKUDS/Vibe-Trading.

  • SKILL.md
  • examples.md

Open the folder on GitHubat commit e532650

Compare with similar skills

Trading Strategy Generator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Trading Strategy Generator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Trading Strategy Generator this skillHKUDS/Vibe-Trading35k—~4.2kAutomated safety check: PassMIT
WorldQuant BRAIN Alpha ResearchQuantML-Research/wq-alpha-research405—~4.9kAutomated safety check: PassNone
CCXT Crypto Exchange Library2025Emma/vibe-coding-cn23k1 repos~4.4kAutomated safety check: PassMIT
TqSdk Trading and Datashinnytech/tqsdk-python5.1k—~2kAutomated safety check: PassApache-2.0
Tushare Datazillionare/zillionare3212 repos~2.3kAutomated safety check: PassNone
Kalshi Traderyanfrigo/kalshi-ai-trading-bot614—~3.4kAutomated safety check: PassMIT

Similar skills

  • WorldQuant BRAIN Alpha Research

    QuantML-Research/wq-alpha-research

    Chinese-language playbook for WorldQuant BRAIN alphas: choose fields, write expressions, backtest, diagnose check failures, tune turnover, submit and build portfolios.

    405 GitHub stars~4.9k tokensUpdated 3 mo ago
    Business, Finance & HRAuto-check passed
  • CCXT Crypto Exchange Library

    2025Emma/vibe-coding-cn

    Reference help for the CCXT library covering crypto exchange APIs, market data, trading and order management across 150+ exchanges in JavaScript, Python and PHP.

    23k GitHub starsUsed in 1 repo~4.4k tokens
    Business, Finance & HRAuto-check passed
  • TqSdk Trading and Data

    shinnytech/tqsdk-python

    Answers TqSdk Python questions on market data, accounts, orders, margin trials, simulation and backtesting, using the library's own docs and examples.

    5.1k GitHub stars~2k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check passed
  • Tushare Data

    zillionare/zillionare

    面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。

    321 GitHub starsUsed in 2 repos~2.3k tokens
    Business, Finance & HRAuto-check passed
  • Kalshi Trade

    ryanfrigo/kalshi-ai-trading-bot

    The disciplined process for autonomously and profitably trading the live Kalshi account on each /loop tick, with Claude as the decision-maker.

    614 GitHub stars~3.4k tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Polymarket Tennis

    livetennisapi/livetennisapi-mcp

    Build observe-only Polymarket and Kalshi tennis market tooling on the polymarket-tennis Python package (MIT) plus the Live Tennis API free tier.

    152 GitHub stars~3k tokensUpdated 2 days ago
    Business, Finance & HRAuto-check passed

More from HKUDS/Vibe-Trading

All 89 skills in this repo
  • Eastmoney Market Data

    HKUDS/Vibe-Trading

    Index of Eastmoney's free, no-token market data interfaces for China A-shares and Hong Kong stocks: fund flows, dragon-tiger lists, margin trading, reports and news.

    35k GitHub stars~1k tokensUpdated today
    Auto-check passed
  • OKX Market Data

    HKUDS/Vibe-Trading

    Retrieves public OKX cryptocurrency market data such as spot prices, candlesticks, funding rates and open interest through the OKX V5 REST API, with no authentication.

    35k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • SEC EDGAR Filings Fetcher

    HKUDS/Vibe-Trading

    Fetches U.S. SEC EDGAR data: resolves tickers to CIK numbers, lists recent 10-K, 10-Q and 8-K filings with document URLs, and pulls XBRL financial series.

    35k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • A-Share ST Risk Screener

    HKUDS/Vibe-Trading

    Predicts whether a mainland China A-share company risks an ST or *ST warning after its next annual report, using financial thresholds and Sina penalty records.

    35k GitHub stars~4.9k tokensUpdated today
    Auto-check passed
  • Breaks a structural trend such as AI infrastructure into its physical supply chain and ranks lesser-known listed companies sitting on each bottleneck.

    35k GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Plans and drafts an eight-part, roughly 120k-word investigative series on one company, built around a strict fact-check pass rather than fast drafting.

    35k GitHub stars~2.4k tokensUpdated today
    Auto-check passed

Works with

Questions about Trading Strategy Generator

What does Trading Strategy Generator do?

Takes a trading idea from request to backtest: pins down instruments and dates, writes config.json and a signal engine, runs the backtest and iterates on the metrics. The skill walks an agent through building a quantitative trading strategy in seven steps: parse the request into instrument codes, time range and logic, design the strategy around five questions, code it, check the syntax, run the backtest, evaluate the results and fix what is weak.py`, which must follow the `SignalEngine` contract, while the built-in `backtest` tool handles data loading and execution.

When should I use Trading Strategy Generator?

Trading Strategy Generator fits situations like: turning a trading idea into a coded and backtested strategy; improving an existing strategy whose backtest results are weak; setting up a backtest with the right date range and indicator warm-up; evaluating a strategy's metrics file against review criteria.

How do I install Trading Strategy Generator in Claude Code?

Run `npx skills add HKUDS/Vibe-Trading --skill strategy-generate -a claude-code`. Or copy the skill folder (agent/src/skills/strategy-generate in HKUDS/Vibe-Trading) into .claude/skills/strategy-generate in your project. Claude Code loads it when a task matches its description.

How do I install Trading Strategy Generator in Codex?

Run `npx skills add HKUDS/Vibe-Trading --skill strategy-generate -a codex`. Or copy the skill folder (agent/src/skills/strategy-generate in HKUDS/Vibe-Trading) into .agents/skills/strategy-generate in your project. Codex loads it when a task matches its description.

Can I use Trading Strategy Generator in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add HKUDS/Vibe-Trading --skill strategy-generate -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/strategy-generate, .gemini/skills/strategy-generate, .github/skills/strategy-generate and .opencode/skills/strategy-generate in your project.

What does Trading Strategy Generator need to run?

Going by SKILL.md and its folder, Trading Strategy Generator needs the command-line tools its instructions call (python). Our summary lists: A backtest engine that provides the `backtest` tool; Python for writing `signal_engine.py`.

Does Trading Strategy Generator access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Trading Strategy Generator safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Trading Strategy Generator use?

Trading Strategy Generator is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Trading Strategy Generator use?

About 4.2k tokens (SKILL.md is roughly 17k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Trading Strategy Generator?

Skills that share tags, products or a category with Trading Strategy Generator: WorldQuant BRAIN Alpha Research (QuantML-Research/wq-alpha-research, 405 stars), CCXT Crypto Exchange Library (2025Emma/vibe-coding-cn, 23k stars), TqSdk Trading and Data (shinnytech/tqsdk-python, 5.1k stars) and Tushare Data (zillionare/zillionare, 321 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Trading Strategy Generator?

HKUDS (a GitHub organization) maintains it in HKUDS/Vibe-Trading, which has 35,043 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on October 8, 2026.

Source: HKUDS/Vibe-Trading on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.