Quantitative Strategy Backtester: Transforming Natural Language Trading Ideas into Executable Historical Backtests

Preface

Quantitative ideas often remain mere talk: a watchlist, a few buy/sell conditions, a position rule. To actually validate them against historical data, one must stitch together stock selection scripts, interface with a backtesting engine, and then parse net asset values and transaction details. If any step in the process is disconnected, the strategy remains trapped in the documentation.

Below is an introduction to the Quant Strategy Backtester (@user_d83d7c97/wm-backtest, current version 0.3.27) on SkillHub. Designed for Agents: describe stock pools, watchlists, or trading logic in natural language. The skill organizes this into a confirmable backtest task, initiates the batch run upon confirmation, and outputs standard metrics like returns and drawdowns, result interpretations, deviation explanations, and actionable improvements for the next round. The official description explicitly states: this is not simulated trading, nor does it place orders on behalf of clients.

What is this

The Quant Strategy Backtester is a community-sourced (community) Agent Skill categorized as professional. It is published at the coordinate @user_d83d7c97/wm-backtest, and the SkillHub page lists the author as Eliaszhou. The tag requires_api_key=false indicates that installation does not strictly require a separate API Key configuration; however, actual batch runs still depend on the underlying Winmale backtesting system and corresponding permission Scopes (see below).

In one sentence: It runs “a batch of stocks + holding/trading rules” through a backtest on historical market data, supports status checks, deep dives into transactions and traces, performs success/failure attribution, and enables small-step iteration for re-running. Watchlists can be viewed in a merged multi-market format, but backtests default to a single market (default: A-shares).

Boundaries with other capabilities in the same series (from skill documentation):

Suitable for this skill Better suited for other skills
A batch of stocks + rules to be validated and reviewed on historical data Just screening stocks → wm-screen-index
Custom stock selection/trading/risk control logic units Just organizing a watchlist → wm-watchlist
Checking batch status, NAV, transactions, traces Intraday real-time / Paper trading / WeCom intents → wm-probe

Core Functions

The following capabilities are derived from the official SKILL.md and the SkillHub profile, and can be understood in terms of a “Management Plane” and an “Engine Plane.”

Management Plane: Units and Batch Runs

  1. Quick Start via Templates: Actions like from_watchlist, from_universe, and from_strategy allow previewing first, then initiating with confirm=true; the default unit is equal_weight_buy_hold.
  2. Custom Strategy Main Path: preview_custom / run_custom (L1 completes create → write → validate → publish → run in one click); the same unit_id can be run again via run_custom for iteration (default overwrite).
  3. Batch Query: list, status, summary; deep analysis available via free scripts or L1 interfaces; suspended quotas can be restored via resume.
  4. Configuration Override: ConfigOverride can modify the backtest window, stock universe, benchmark, script_params, etc., without altering the body of the stage scripts.

Engine Plane: Trading Day Pipeline

Each trading day executes in a fixed order: selector → selector_rank → trading → risk → matching. Custom stages must comply with the XS simulation library contract (prioritize data fetching via simulation.* / bt.*, avoiding look-ahead bias/future functions); after modifying stage scripts, fixture checks should be performed before lint / preview / run.

Output and Review

After the batch run, standard metrics such as returns and drawdowns can be read from the summary. Combined with deep (ledger) and trace (process logs) for attribution, the skill requires outputting historical conclusions, execution evidence, attribution, and 1–3 actionable modifications for the next run, while declaring that the content does not constitute investment advice.

SkillHub Statistics (from crawled data): Rating 100000, Downloads 5827.

Installation and Activation

The installation method provided on the official page is: Instruct the Agent to install @user_d83d7c97/wm-backtest according to the SkillHub Installation Instructions.

If SkillHub CLI is already installed locally, it can be installed directly into the current Agent’s skills directory (must use --dir, otherwise the default ./skills/ might not be recognized):

command -v skillhub && skillhub --version

If the CLI is not installed, you can execute the full installation or just the CLI via the installation documentation:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

Install this skill (namespace matches search results):

skillhub install wm-backtest --namespace user_d83d7c97 --dir <your Agent skills directory>

Skills paths for common Agents (from SkillHub installation docs):

  • Cursor: ~/.cursor/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project
  • Claude Code: ~/.claude/skills/

After installation, restarting or refreshing the Agent is generally required to load the skill. The skill package includes references/ and examples/; the Agent invokes them according to the SKILL.md workflow. Some examples require coordination with the same ecosystem’s wm.sh run (the documentation example path is bash .cursor/skills/wm-skillhub/scripts/wm.sh run wm-backtest ...); specifics depend on your locally installed Winmale / wm skill layout.

Typical Usage

Natural Language Entry

Question styles suggested by the skill documentation include:

  • “Run an A-share backtest using my watchlist, preview first then run.”
  • “Buy if PE<15, sell on 10% unrealized gain, last 3 years; custom unit.”
  • “Why did the last backtest gain/lose? Which part should I change for the next run?”

The Agent should first collect the task into structured parameters; without user confirmation, it must not initiate the batch run with confirm=true.

Watchlist Preview (JSON Example)

The package’s examples/from_watchlist_preview.json demonstrates a preview request for a Management Plane template batch run: business parameters are placed inside args (a flat action will trigger ARGS_REQUIRED).

{
  "mode": "call",
  "args": {
    "action": "from_watchlist",
    "backtest_market": "cn",
    "group_name": "重点关注",
    "start": "2023-01-01",
    "end": "2025-12-31",
    "confirm": false
  }
}

After the user confirms the configuration, set confirm to true and run. See SKILL.md for the equivalent CLI invocation form:

bash .cursor/skills/wm-skillhub/scripts/wm.sh run wm-backtest \
  '{"action":"from_watchlist","backtest_market":"cn","confirm":false}' --result

(In production environments, place fields like action inside args, consistent with the HTTP contract.)

Custom Units and Iteration

Complex logic goes through run_custom: first preview_custom, then run_custom with confirm=true. The package also includes examples/run_custom_full.json, examples/pe_filter_trading.json, etc. Complex stage scripts can be referenced via @pack:wm-backtest/examples/xs/....

The strategy iteration loop is documented as: Baseline → Modify Stage → Harness Fixture CHECK → Lint → Preview → Run → Deep + Trace → Attribution → Modification Plan → Re-run.

Applicable Scenarios and Notes

Who it is for

  • Users with existing stock pools, watchlist groups, or text-based trading rules who need validation on historical data, rather than intraday copy trading.
  • Users wanting the Agent to organize backtest tasks, read summaries/deep results, and provide actionable suggestions for the next iteration.
  • Developers willing to use custom XS stages (selector / trading / risk, etc.) within the same ecosystem and comply with the simulation API contract.

Limitations and Notes

  1. Not Simulated Trading: It does not provide real-time market sessions; for intraday probing, use wm-probe.
  2. Confirmation Gate: confirm=true is forbidden without confirmation; unit_id conflicts will return UNIT_EXISTS.
  3. Permissions and Billing: Read/deep read, initiating from_* / run, run_custom, etc., correspond to different Scopes (e.g., analysis:backtest:read, analysis:backtest:run, project:write, etc.); from_watchlist also requires user:watchlist:read.
  4. Markets: Backtests are per single market; the default benchmark for CN is index.hs300, overridable via args.benchmark.
  5. Template Limitations: from_watchlist / from_universe do not support custom weights; target weights must go through run_custom.

Conclusion

The Quant Strategy Backtester consolidates “describe idea → confirm task → historical batch run → metrics and attribution → iterative modification” into an Agent-executable chain. It is suitable for pressing verbal strategies onto historical evidence as quickly as possible, rather than replacing a trading terminal.

  • SkillHub Page: https://www.skillhub.cn/skills/user_d83d7c97/wm-backtest
  • Skill Coordinate: @user_d83d7c97/wm-backtest
  • Official Address: https://api.skillhub.cn/user_d83d7c97/wm-backtest
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye