What it does
天勤量化开发包, 期货量化, 实时行情/历史数据/实盘交易
- Connects Instruction files the AI reads
- Account or key Not confirmed yet (README not read yet)
- Category Coding
For makers: add a badge to your README
If you made this, paste this code into your README. The badge links back to this page.
[](https://mcp.popnx.com/en/skills/shinnytech-tqsdk-python)Use together with
MCP servers that connect the AI to services for the same work
Fallow
Codebase intelligence for TypeScript and JavaScript, exposed as structured MCP analysis tools.
Desktop Commander
MCP server for terminal commands, file operations, and process management
Similar Skills
Same kind of work, ordered like the Skills list
| This one tqsdk-python | rea | andrej-karpathy-skills | graphify | MoneyPrinterTurbo | |
|---|---|---|---|---|---|
| Maker | shinnytech | morluto | multica-ai | Graphify-Labs | harry0703 |
| Skills | 1 | 1 | 1 | 1 | 1 |
| GitHub stars | 5,144 | 463,670 | 233,682 | 148,887 | 143,987 |
| Last code change | Oct 26, 2026 | Nov 17, 2026 | Apr 20, 2026 | Nov 17, 2026 | Nov 16, 2026 |
| License | Apache-2.0 | MIT | – | Apache-2.0 | MIT |
1 skills (instruction sets) by shinnytech that an AI reads and follows · not an MCP server
How a Skill differs from MCP
MCP = the hands
Connects the AI to an outside service or data, such as reading Notion or creating an invoice. A program or server has to be running.
Skill = the manual
A text file that teaches the AI how to do a task. It connects to nothing.
Some overlap: a few Skills run scripts that call tools, and a few MCP servers only send knowledge. Start from the task you want done.
Works with
Codex
From the maker’s README and the folders in the repo
Install
Is it safe?
- Who made it
GitHub account shinnytech (organization), 10 years old
- Use and upkeep
★ 5,144 stars · code last changed Oct 26, 2026
- Any scripts?
1 scripts that can run on a computer: scripts/check_environment.py
- Uses the internet?
No internet calls found in the scripts
- Changes machine-wide settings?
No hooks or writes to machine settings found
Checked automatically from the repo files at commit cde7f57 (read only, nothing was run). Not a safety guarantee: read it and decide for yourself
First: which AI do you use?
Pick your app and this page shows only how to install it there
Option 1Upload to claude.ai (web and app)
Files are byte-for-byte the same as on GitHub at commit cde7f57 · View on GitHub ↗
1 scripts
Once uploaded it runs on Claude’s systems, not on your computer. No need to unzip
Look inside before downloading
All 15 files · 81 KB
SKILL.md5 KBagents/openai.yaml1 KBreferences/account-type-matrix.md4 KBreferences/accounts-and-trading.md5 KBreferences/environment-setup.md4 KBreferences/error-faq.md7 KBreferences/example-map.md5 KBreferences/market-data.md5 KBreferences/object-fields.md7 KBreferences/order-functions-and-position-tools.md10 KBreferences/scenario-and-margin.md8 KBreferences/simulation-and-backtest.md4 KBreferences/wait-update-and-update-loop.md5 KBscripts/check_environment.py2 KBLICENSE11 KB
Download tqsdk-trading-and-data.zip
Open Skills on claude.ai and upload
+Create skillUpload a skillpick tqsdk-trading-and-data.zip
No Upload button? Turn on file creation first
SettingsCapabilitiesCode execution and file creation
Turn on Code execution and file creation first (newer menus: Create and edit files) · personal plans: Settings → Capabilities · Team/Enterprise: an admin turns it on under Organization settings → Plugins & skills · every plan, including Free
Upload once; it works in claude.ai and Claude Desktop, and in recent Claude Code signed in with a Claude account (not with an API key)
Cowork and cloud sessions use the skills turned on in your claude.ai account, not ~/.claude/skills on your computer (Claude Desktop scheduled tasks run locally and still load it)
Checked against official docs Nov 12, 2026 · Source: support.claude.com, support.claude.com, code.claude.com
Option 1Let Claude Code install it
Copy this sentence and paste it into a Claude Code chat
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Restart Claude Code, then type /tqsdk-trading-and-data or ask for a matching task and Claude picks it up
Checked against official docs Nov 12, 2026 · Source: code.claude.com
For Terminal users
A Skill is instructions the AI will follow. Read the files before installing, and install only from makers you trust.
Open Terminal
Mac: press Command+Space and type Terminal · Windows: the command below does not work in PowerShell; use “Let AI install it” above instead
Copy the skill folder to ~/.claude/skills
This downloads the repo to a temporary folder and copies only the folders that contain a SKILL.md
git clone --depth 1 https://github.com/shinnytech/tqsdk-python.git /tmp/popnx-skill-shinnytech-tqsdk-python-cde7f57 && mkdir -p ~/.claude/skills && cp -R '/tmp/popnx-skill-shinnytech-tqsdk-python-cde7f57/doc/ai_editor/skills/tqsdk-trading-and-data' ~/.claude/skills/tqsdk-trading-and-dataRestart Claude Code, then type /tqsdk-trading-and-data or ask for a matching task and Claude picks it up
ChatGPT desktop app
The ChatGPT desktop app has Codex built in, and Codex reads skills from ~/.agents/skills
Option 1Let ChatGPT install it
Open Codex in the ChatGPT desktop app and paste this sentence into the chat
The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Option 2Put the folder there yourself
Put the tqsdk-trading-and-data folder at ~/.agents/skills/tqsdk-trading-and-data
~ is your home folder ($HOME)
Without Terminal: download the ZIP, unzip it and move the tqsdk-trading-and-data folder to ~/.agents/skills
Download tqsdk-trading-and-data.zip
For Terminal users
A Skill is instructions the AI will follow. Read the files before installing, and install only from makers you trust.
Open Terminal
Mac: press Command+Space and type Terminal · Windows: the command below does not work in PowerShell; use “Let AI install it” above instead
Copy the skill folder to ~/.agents/skills
This downloads the repo to a temporary folder and copies only the folders that contain a SKILL.md
git clone --depth 1 https://github.com/shinnytech/tqsdk-python.git /tmp/popnx-skill-shinnytech-tqsdk-python-cde7f57 && mkdir -p ~/.agents/skills && cp -R '/tmp/popnx-skill-shinnytech-tqsdk-python-cde7f57/doc/ai_editor/skills/tqsdk-trading-and-data' ~/.agents/skills/tqsdk-trading-and-data
After installing
- ChatGPT desktop app: open Skills in the sidebar to see that the skill is there
- To use it: in ChatGPT type @ and pick the skill · in Codex CLI or the IDE extension run /skills or type $ and the skill name
- Codex picks up newly installed skills by itself; if one does not show up, restart Codex
Checked against official docs Nov 15, 2026 · Source: learn.chatgpt.com
ChatGPT on the web and mobile
Skills you install yourself do not work here; only skills that come with a plugin from the directory
To use this skill with ChatGPT, use the ChatGPT desktop app as above
Checked against official docs Nov 15, 2026 · Source: learn.chatgpt.com
Option 1Let Codex install it
Copy this sentence and paste it into a Codex chat · Works in Codex inside the ChatGPT desktop app, Codex CLI and the IDE extension
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Codex picks up newly installed skills by itself; if one does not show up, restart Codex · To use it: in ChatGPT type @ and pick the skill · in Codex CLI or the IDE extension run /skills or type $ and the skill name
Checked against official docs Nov 15, 2026 · Source: learn.chatgpt.com
For Terminal users
A Skill is instructions the AI will follow. Read the files before installing, and install only from makers you trust.
Open Terminal
Mac: press Command+Space and type Terminal · Windows: the command below does not work in PowerShell; use “Let AI install it” above instead
Copy the skill folder to ~/.agents/skills
This downloads the repo to a temporary folder and copies only the folders that contain a SKILL.md
git clone --depth 1 https://github.com/shinnytech/tqsdk-python.git /tmp/popnx-skill-shinnytech-tqsdk-python-cde7f57 && mkdir -p ~/.agents/skills && cp -R '/tmp/popnx-skill-shinnytech-tqsdk-python-cde7f57/doc/ai_editor/skills/tqsdk-trading-and-data' ~/.agents/skills/tqsdk-trading-and-dataRestart Codex, then ask for a matching task; Codex lists the skill
Option 1Let Cursor install it
Copy this sentence and paste it into a Cursor chat
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
In Cursor’s Agent chat, type / and pick tqsdk-trading-and-data
Checked against official docs Nov 12, 2026 · Source: cursor.com
For Terminal users
A Skill is instructions the AI will follow. Read the files before installing, and install only from makers you trust.
Open Terminal
Mac: press Command+Space and type Terminal · Windows: the command below does not work in PowerShell; use “Let AI install it” above instead
Copy the skill folder to ~/.cursor/skills
This downloads the repo to a temporary folder and copies only the folders that contain a SKILL.md
git clone --depth 1 https://github.com/shinnytech/tqsdk-python.git /tmp/popnx-skill-shinnytech-tqsdk-python-cde7f57 && mkdir -p ~/.cursor/skills && cp -R '/tmp/popnx-skill-shinnytech-tqsdk-python-cde7f57/doc/ai_editor/skills/tqsdk-trading-and-data' ~/.cursor/skills/tqsdk-trading-and-dataIn Cursor’s Agent chat, type / and pick tqsdk-trading-and-data
Option 1Let the AI install it
For other apps that read skills. The sentence gives the paths for Claude Code, Codex and Cursor so the AI picks the one for your app · Copy this sentence into the app’s chat
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Checked against official docs Nov 12, 2026 · Source: code.claude.com, learn.chatgpt.com, cursor.com
For Terminal users
Other apps that support Agent Skills (such as Gemini CLI or GitHub Copilot) use different folders. Check that app’s guide, then copy the folder with the SKILL.md there.
Skill folders checked against the official Claude Code, Codex and Cursor guides on Nov 11, 2026
✓ Commands checked Nov 17, 2026
View the original SKILL.md
The text below comes from the maker’s repo, not from PopNx MCP
2,905 characters · Open the full file on GitHub
---
name: tqsdk-trading-and-data
description: "使用 TqSdk Python SDK 获取行情与历史数据、编写或排查交易与回测程序,并在需要本地运行时检查环境、安装缺失的 TqSdk。适用于明确使用 TqSdk、TqApi、TargetPosTask 等接口的开发、数据和账户问题;通用金融问答或其他数据产品不必使用本技能。"
---
# TqSdk Trading and Data
用实际接口完成用户的 TqSdk 任务。先确定任务和运行环境,按需读取专题参考,再生成最小可运行方案并验证结果。技能包是使用说明,不是已安装的 SDK,也不代表已经连接任何账户。
## 开始处理
1. **确认任务范围。** 区分接口解释、代码编写、本地执行和实盘操作。尊重用户指定的账户、合约、时间范围和项目约束;只有缺少会影响结果的必要信息时才询问。
2. **需要本地运行时,先检查环境。** 用项目实际运行脚本的解释器执行 [scripts/check_environment.py](scripts/check_environment.py)。只解释接口时不必安装软件。若状态为 `not_installed`,按 [environment-setup.md](references/environment-setup.md) 在当前项目环境中安装 TqSdk,验证导入后继续任务。已有版本可用时不自动升级;导入损坏不能当成未安装处理。
3. **以用户版本为准。** 优先检查已安装 SDK 的签名、docstring 和相关源码;有仓库时参考对应版本的源码。发布文档和技能示例可能比用户版本新,不要虚构接口或为了一个示例擅自升级。技能内的仓库路径不保证存在于用户电脑上,替代入口见 [example-map.md](references/example-map.md)。
4. **选择运行模式。** 仅取数或无账户要求的入门程序可显式用 `TqSim()`;用户要求快期模拟、实盘或股票账户时保留该选择。`TqAuth` 是快期服务认证,`TqAccount` 是期货资金账户。实盘登录失败时报告错误,不能悄悄换成模拟账户。
5. **验证并交付。** 先做语法和导入检查,再按任务验证实际数据、输出文件或回测结果。缺少认证时继续完成可离线验证的部分,明确未运行的步骤。报告使用的解释器、SDK 版本和实际验证结果;不能把语法通过说成行情或交易成功。
## 按任务读取
| 当前任务 | 参考文件 |
| --- | --- |
| 安装、解释器、依赖或导入错误 | [environment-setup.md](references/environment-setup.md) |
| `wait_update`、`is_changing`、超时与异步通知 | [wait-update-and-update-loop.md](references/wait-update-and-update-loop.md) |
| 行情、K 线、Tick、合约发现和历史下载 | [market-data.md](references/market-data.md) |
| 选择本地模拟、快期模拟、实盘、股票或多账户 | [account-type-matrix.md](references/account-type-matrix.md) |
| 读取资金、持仓、委托、成交 | [accounts-and-trading.md](references/accounts-and-trading.md) |
| 手工下单、撤单、目标持仓、调度执行和最小开仓手数 | [order-functions-and-position-tools.md](references/order-functions-and-position-tools.md) |
| 数据与账户对象的字段含义 | [object-fields.md](references/object-fields.md) |
| 模拟与历史回测 | [simulation-and-backtest.md](references/simulation-and-backtest.md) |
| 保证金、风险度和 `TqScenario` 试算 | [scenario-and-margin.md](references/scenario-and-margin.md) |
| 运行错误与排查顺序 | [error-faq.md](references/error-faq.md) |
| 官方示例、文档和源码定位 | [example-map.md](references/example-map.md) |
## 编写代码时保持的规则
- `get_*` 通常返回持续更新的引用。订阅一次并保存对象,用 `wait_update()` 推进,再用 `is_changing()` 或明确的就绪条件处理相关更新。需要历史快照时显式复制;不要通过反复订阅或 `sleep()` 等待数据。
- K 线 `iloc[-1]` 是正在形成的柱。按收盘信号交易时,在新柱出现后使用 `iloc[-2]` 和已完成的窗口;检查长度、`NaN` 和数据时间。回测保持用户原有信号、撮合和估值时点,不用未来数据。
- 当前行情示例优先使用 `KQ.m@...` 主连;主连不能直接下单。交易用用户指定或已核实的真实合约,必要时读取主连的 `underlying_symbol`;不能把合约列表第一项当成主力。历史回测按目标日期核实合约覆盖,不用今天的 `expired=False` 排除历史合约。
- `insert_order()` 返回不代表成交,`FINISHED` 也可能是撤单或拒单。结合 `volume_left`、`last_msg` 和成交记录判断;有时限时报告实际状态,不能将超时当作已撤单。
- 同一账户、同一合约选择一种持仓控制方式。不要把 `TargetPosTask` 与手工下单混用;股票账户不使用期货 `offset` 或 `TargetPosTask`。多账户操作明确传入 `account=`。
- 用环境变量、交互式隐藏输入或项目已有安全配置提供凭据,不把真实密码写进示例、日志或聊天。安装、导入和只读取数不包含实盘下单授权;执行实盘下单或撤单前,确认操作参数在用户已有授权范围内。
- API 会话用上下文管理器或 `finally: api.close()` 释放。回测处理 `BacktestFinished`,交互式取数在需要时设置合理超时并报告是否收到有效数据。
- `TqScenario` 只做期货快照试算。计算当前账户风险时显式传入该账户权益;说明保证金数据来自行情还是账户查询及可能的回退。试算结果不保证真实可成交手数,详细限制按需读取专题参考。
Discussion
Ask, share a tip or report that it does not work. Sorted by what people marked helpful.
No posts yet. Be the first to ask or share.
Posts here are written by users, not the PopNx team.
From GitHub
- GitHub stars
- 5,144
- Maker
- shinnytech
- License
- Apache-2.0
- Last code change
- Oct 26, 2026
- SKILL.md files in the repo (including translated copies and templates)
- 1
- Topics
- diff, futures, program-trading, python, quant, tqsdk