Foreword¶
Many quantitative developers first write indicators, stock selection, or trading system formulas in TongDaXin (TDX), then manually port them to Python for backtesting or connecting to live trading. In the process, they have to remember two sets of syntaxes and repeatedly check for future functions and syntax errors. Modifying a formula often involves repeated copying and rewriting. If one could directly write formulas according to TongDaXin habits in a conversational coding environment, perform checks, and generate Pandas/Numpy code, the “formula—strategy code” segment could be integrated into a single workflow. Below is an introduction to the community Skill “XiaoGu TongDaXin Function Quant Assistant” on SkillHub, maintained by the author XiaoGu, located at @user_676c825d/xg-tdx-func-quant, with the current version being 1.0.2.
What is it¶
“XiaoGu TongDaXin Function Quant Assistant” is an Agent Skill oriented towards TongDaXin formula quantification, categorized under dev-programming, sourced from the community. It revolves around three things: assisting in writing TongDaXin formulas within Agent conversations and performing syntax and future function detection; converting formulas into Pandas/Numpy-based strategy code; and providing a function library implementation aligned with TongDaXin usage (the official description claims coverage of 400+ TongDaXin official functions). The author is XiaoGu, WeChat xg_quant, focusing on TongDaXin formula quantification, strategy development, and formula-to-Python conversion. The Skill page is labeled requires_api_key=false, meaning it can be used without an extra API key.
Core Functions¶
According to the SkillHub introduction, the capabilities are divided into three parts, all of which are stated in the page copy.
Formula Writing and Syntax Detection¶
Supports writing assistance for TongDaXin formula types such as technical indicators, conditional stock selection, trading systems, and five-color K-lines, and performs automatic detection of syntax errors and future functions. For users accustomed to writing indicators or stock selection logic like KDJ, MACD, RSI, CCI, Bollinger Bands, etc., in TongDaXin, they can describe their requirements using natural language in the conversation. The Skill guides the output of expressions that comply with TongDaXin syntax and performs a round of static checks before finalization.
Formula to Python¶
Converts TongDaXin formulas into Pandas/Numpy-based implementations with one click. The official description states it can be used for bridging backtesting and live trading. This means that the finalized TongDaXin formula in the Agent can be further generated into code that can be directly integrated into the Python quant stack, reducing the repetitive labor of manually writing rolling, shift, etc., which differ literally from TongDaXin function names.
Full Function Library Alignment¶
Provides implementations of 400+ TongDaXin official functions on the Python side, maintaining usage consistency with TongDaXin. When converting code or writing strategies manually, if one needs to call the semantics of built-in TongDaXin functions, they can rely on the knowledge and practice path bound to this Skill to avoid guessing parameter meanings or deviating from the official documentation. Trigger keywords (to facilitate activation in products that support Skills) include: TongDaXin, TDX, XiaoGu, xg_quant, formula writing, stock selection formula, indicator formula, formula to Python, technical indicators, financial stock selection, sector analysis, write indicators, trading systems, five-color K-lines, and common indicator names.
Installation and Activation¶
The public page does not provide platform-specific installation command differences for Cursor, Codex CLI, or Claude Code, so this article will not list unverified CLIs. The confirmed information is as follows.
- Official Skill Page: https://www.skillhub.cn/skills/user_676c825d/xg-tdx-func-quant
- Skill Coordinates:
@user_676c825d/xg-tdx-func-quant - Version: 1.0.2
- No API Key required:
requires_api_key=false
In clients that have integrated SkillHub or support importing community Skills, add the Skill from the page above or the coordinates according to the product documentation. After adding, use the trigger keywords in the introduction (such as “TongDaXin”, “formula to Python”, “stock selection formula”) in the conversation, and the model will load the behavior description of the skill according to the SKILL.md convention.
Typical Usage¶
The following process is consistent with the official description and can involve proposing requirements step-by-step in the Agent without relying on fictional case data.
-
Write indicator or stock selection formula
Explain the formula type (e.g., technical indicator or conditional stock selection) and logic (e.g., moving average crossover, overbought/oversold conditions). Ask the Skill to produce the formula body according to TongDaXin syntax and request a syntax and future function check. -
Convert Python strategy snippet
After the formula is confirmed, explicitly request “formula to Python” and state the desire to base it on Pandas/Numpy. The output should be vectorized calculation code that can be embedded into a backtesting framework; the specific framework name needs to be specified by yourself in the conversation, as the Skill introduction does not bind to a single backtesting engine. -
Check function semantics
When rewriting or verifying a specific TongDaXin function, directly write the function name or paste the formula snippet and verify it against the “Python implementation consistent with TongDaXin”.
Example request phrasing (illustrative, not an official fixed prompt):
请用通达信语法写一个条件选股公式:5日均线上穿10日均线,且成交量大于5日均量。
写完后检查未来函数和语法错误,再转为 Pandas/Numpy 代码。
Suitable Scenarios and Notes¶
Who is it for: Individuals or small teams familiar with TongDaXin formulas who wish to complete the writing—check—conversion pipeline in an AI programming assistant; developers who need to migrate historical TongDaXin indicators/stock selection logic to a Python backtesting environment.
Prerequisites: Have a basic understanding of TongDaXin formula types (indicators, stock selection, trading systems, five-color K-lines); the Python side still requires self-provided market data and backtesting/live trading environments. The Skill provides formula and code generation capabilities, not including data sources or broker interfaces.
Limitations and Verification: SkillHub classifies this as a community Skill (as of page info: rating 100000, downloads 1118 times, install count 0, subject to platform display). The code converted to Python still needs to undergo out-of-sample verification and performance evaluation locally; future function detection is an auxiliary means and cannot replace a complete audit before live trading. For more details or updates, please refer to the v1.0.2 description on the SkillHub page.
Conclusion¶
“XiaoGu TongDaXin Function Quant Assistant” integrates TongDaXin formula writing, syntax and future function detection, and conversion to Pandas/Numpy into the same Agent Skill, emphasizing function library coverage consistent with TongDaXin. It is suitable for developers transitioning from the TongDaXin ecosystem to Python quantification. For installation and details, see SkillHub: https://www.skillhub.cn/skills/user_676c825d/xg-tdx-func-quant; author contact WeChat: xg_quant.