shinnytech/tqsdk-python is an open-source Python library for developing quantitative trading strategies with futures, options, and stocks. It provides market data, backtesting, simulated trading, live trading, monitoring, and risk-management functions for quantitative developers and traders. The catalogue skill teaches AI agents how to use TqSdk for trading and data tasks.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/shinnytech/tqsdk-python/tqsdk-trading-and-datanpx skills add shinnytech/tqsdk-python --skill tqsdk-trading-and-datagit clone --depth 1 https://github.com/shinnytech/tqsdk-pythonWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/shinnytech/tqsdk-python/tqsdk-trading-and-data)<a href="https://agentmods.dev/skills/shinnytech/tqsdk-python/tqsdk-trading-and-data"><img src="https://agentmods.dev/badge/skills/shinnytech/tqsdk-python/tqsdk-trading-and-data.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00286 | $0.01968 |
| Opus 5 | $0.00143 | $0.00984 |
| Sonnet 5 | $0.00057 | $0.00394 |
| Haiku 4.5 | $0.00029 | $0.00197 |
Grade A, and why
tqsdk-trading-and-data scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 69 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TqSdk Trading and Data
Use this skill to answer TqSdk questions with the repository's real APIs, docs, and examples. Prefer minimal runnable snippets, keep futures and stock behavior separate, and explain the update loop explicitly whenever the user's issue depends on wait_update().
Route The Request First
Read only the references needed for the user's question.
- Read references/wait-update-and-update-loop.md for
wait_update,is_changing,deadline, async update notifications, Jupyter caveats, or backtest progression questions. - Read references/market-data.md for
get_quote,get_kline_serial,get_tick_serial, contract discovery, symbol metadata, andDataDownloader. - Read references/account-type-matrix.md for
TqAccount,TqKq,TqKqStock,TqSim,TqSimStock,TqTradingUnit, OTG account classes, andTqMultiAccount. - Read references/accounts-and-trading.md for account, position, order, and trade getters plus multi-account getter patterns.
- Read references/scenario-and-margin.md for
TqScenario, real-account margin-rate lookup, margin occupancy calculation, risk-ratio what-if analysis, and limited built-in margin discount rules. - Read references/order-functions-and-position-tools.md for
insert_order,cancel_order,TargetPosTask,support_open_min_volume,TargetPosScheduler,Twap, and advanced execution helpers. - Read references/object-fields.md when the user asks what fields mean on
Quote, K-line or tick rows,Account,Position,Order,Trade, or their stock variants. - Read references/simulation-and-backtest.md for local sim, Quick sim, stock sim, backtest, and cross-account backtest limits.
- Read references/error-faq.md when the user asks about common TqSdk failures, confusing behavior, or exception messages.
- Read references/example-map.md when you want a repository-backed example or doc page to imitate.
What ships with it
11 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- agents/openai.yaml 257 B
- references/account-type-matrix.md 4.0 KB
- references/accounts-and-trading.md 4.6 KB
- references/error-faq.md 6.8 KB
- references/example-map.md 3.4 KB
- references/market-data.md 4.7 KB
- references/object-fields.md 6.8 KB
- references/order-functions-and-position-tools.md 8.5 KB
- references/scenario-and-margin.md 6.1 KB
- references/simulation-and-backtest.md 3.3 KB
- references/wait-update-and-update-loop.md 4.1 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 69 lines · 286 tokens per session scan A 5c579b9c4ce0
tqsdk-trading-and-data is a skill published in the GitHub repository shinnytech/tqsdk-python (4,998 stars, last pushed 19d ago), licensed Apache-2.0. It adds 286 tokens to every session and 1,968 once invoked, about $0.0014 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
vnpy-export
Export a Vibe-Trading backtest strategy to a runnable vnpy CtaTemplate Python class — supports A-share equities, futures, and crypto via BarGenerator + ArrayManager.
yfinance
Skill "yfinance" from HKUDS/Vibe-Trading, covering yfinance, deep yahoo interfaces (references/), quick start, ticker format conversion and supported data types.
miniqmt-to-bigqmt
将基于 miniQMT 的外部 xtquant 库(xttrader/xtdata)的 Python 量化策略,转换为大QMT内置Python(ContextInfo/passorder 体系)可实盘运行的策略。当用户要求转换 miniQMT 策略、迁移 xtquant 代码到大QMT、或提到"内置Python/XTData/passorder 改写"时使用。包含可行性评估、API 映射、py3.6+GBK 约束校验、部署与实盘验证全流程;不可转换场景给出文件桥等替代方案。.
python-workspace
Python workspace for MQL5 integration. TRIGGERS - MetaTrader 5 Python, mt5 package, MQL5-Python setup.
tushare
Skill "tushare" from skloxo/TideTrading, covering tushare, 概述, 快速上手, 读取环境变量中的token, 或者读取本地记录的token and 初始化pro接口实例.
yfinance
Skill "yfinance" from skloxo/TideTrading, covering yfinance, deep yahoo interfaces (references/), quick start, ticker format conversion and supported data types.