Wtpy logo

Wtpy

Community
algoderiv
wtpy

WonderTrader/wtpy 量化交易开发综合指南,整合官方文档、社区笔记与实践案例。涵盖 wtpy Python 框架与 WonderTrader C++ 核心的策略开发、回测、仿真、实盘、数据管理、监控运维全流程。

Overview

Publisheralgoderiv
Repositoryagent-skills
Skill namewtpy
Stars
59
Forks
3
Bundled files
13
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 13 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by algoderiv on GitHub. Read the source before you install it.

Installation

Install the Wtpy AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/algoderiv/agent-skills/tree/main/skills/wtpy
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/algoderiv/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/skills/wtpy .claude/skills/wtpy
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Wtpy in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Wtpy on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Wtpy is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

WonderTrader/wtpy Development Guide

综合 WonderTrader 官方文档(Read the Docs)、社区学习笔记(WonderTrader-Learning-Notes)和非官方整理文档(docs_wondertrader)三大来源,为 wtpy/WonderTrader 量化交易开发提供一站式参考。

When to Use This Skill

This skill should be triggered when:

  • 使用 wtpy (WonderTrader Python 框架) 开发量化策略
  • 使用 WonderTrader C++ 核心进行高频/极速交易开发
  • 配置和运行 CTA/SEL/HFT/UFT 引擎
  • 进行策略回测、仿真交易或实盘交易
  • 处理行情数据(DSB/CSV 转换、数据录制、历史数据管理)
  • 配置和使用 WtMonSvr 监控服务或 WtStudio
  • 对接 CTP/openctp/XTP 等交易和行情接口
  • 开发自定义执行器(ExtExecuter)或行情解析器(ExtParser)
  • 排查 WonderTrader 常见问题(编译、配置、运行)

Quick Reference

Installation

bash
pip install wtpy --upgrade

Backtest (CTA)

python
from wtpy import WtBtEngine, EngineType
from wtpy.apps import WtBtAnalyst

engine = WtBtEngine(EngineType.ET_CTA)
engine.init('../common/', "configbt.yaml")
engine.configBacktest(202201100930, 202202011500)
engine.commitBTConfig()

straInfo = StraDualThrust(name='pydt_cu', code="SHFE.cu.HOT",
    barCnt=50, period="m5", days=30, k1=0.1, k2=0.1, isForStk=False)
engine.set_cta_strategy(straInfo)
engine.run_backtest()

analyst = WtBtAnalyst()
analyst.add_strategy("pydt_cu", folder="./outputs_bt/pydt_cu/",
    init_capital=500000, rf=0.02, annual_trading_days=240)
analyst.run()
engine.release_backtest()

Live Trading (CTA)

python
from wtpy import WtEngine, EngineType

env = WtEngine(EngineType.ET_CTA)
env.init('../common/', "config.yaml")
straInfo = StraDualThrust(name='pydt_au', code="SHFE.au.HOT",
    barCnt=50, period="m5", days=30, k1=0.2, k2=0.2, isForStk=False)
env.add_cta_strategy(straInfo)
env.run()

Contract Code Format

  • 期货合约: CFFEX.IF.2306
  • 期货主力: CFFEX.IF.HOT
  • 商品期权: CFFEX.IO2007.C.4000
  • 股票: SSE.STK.600000
  • ETF期权: SSE.ETFO.10003961

Trading Engines

引擎适用场景驱动方式延迟
CTA少标的择时/套利事件+时间~70μs (Python)
SEL多因子选股时间(异步)-
HFT高频交易事件1-2μs
UFT超高频(仅C++)事件<200ns

Reference Files

This skill includes comprehensive documentation in references/:

Getting Started & Architecture

  • getting-started-official.md - 官方快速入门(安装、demo运行、回测分析)
  • getting-started-notes.md - 社区学习笔记(版本选择、策略编写、环境部署、回测与实盘详解)
  • architecture.md - 架构分析(信号与交易解耦、策略组、风控管理)

Strategy Development

  • strategies.md - 经典策略实现(DualThrust、ATR、菲阿里四价、空中花园等)
  • api.md - 策略 API 详解(数据接口、交易接口、信号接口)及行情/交易接口对接

Configuration & Data

  • configuration.md - 配置文件详解(configbt.yaml、config.yaml、actpolicy.yaml、executers.yaml 等)
  • data-tools.md - 数据工具(WtDataHelper、CSV/DSB 转换、Tick数据处理)
  • data-management.md - 数据管理(WtDtServo、ExtDataLoader/Dumper、历史数据处理、WtDHFactory)

Advanced Development

  • advanced.md - 进阶开发(ExtParser、ExtExecuter、C++开发环境搭建、自定义数据存储)
  • wtcpp-modules.md - C++ 模块详解(QuoteFactory、CTA/HFT仿真、下单流程、配置文件源码分析)
  • source-analysis.md - 源码解析(回测框架、执行单元、HFT引擎、CTA引擎、信号执行流程)

Operations & Troubleshooting

  • tools-console.md - Web 控制台与 WtStudio 使用手册(监控、调度、回测查看、参数优化)
  • faq.md - 常见问题(引擎选择、合约代码规则、openctp 对接、CTA 下单接口详解)

Documentation Sources

SourceTypePagesURL
WonderTrader 官方文档Official (RTD)53https://wtdocs.readthedocs.io/zh/latest/
WonderTrader 学习笔记Community75https://zzzzhej.github.io/WonderTrader-Learning-Notes/
WonderTrader 非官方文档Unofficial27https://dumengru.github.io/docs_wondertrader/

Key Resources

Notes

  • This skill was consolidated from three separate documentation sources
  • Reference files preserve the original structure and code examples
  • Content is primarily in Chinese (中文), matching the original documentation
  • Code examples include both Python (wtpy) and C++ (WonderTrader core) implementations

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Wtpy AI skill do?

WonderTrader/wtpy 量化交易开发综合指南,整合官方文档、社区笔记与实践案例。涵盖 wtpy Python 框架与 WonderTrader C++ 核心的策略开发、回测、仿真、实盘、数据管理、监控运维全流程。

Why use Wtpy on TypingMind?

Because you install it once and use it with any model. Wtpy is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Wtpy in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/algoderiv/agent-skills/tree/main/skills/wtpy. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Wtpy?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Wtpy?

As many as you like. As long as a model supports skills, you can use Wtpy with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Wtpy AI skill free?

It is published on GitHub by algoderiv. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇