rqdata-python

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

rqdata-python

rqdata-python

每次skill使用前,执行
python ~/.claude/skills/rqdata-python/scripts/init_skill.py
。如果返回RQData license不可用,则提示用户
需正确安装rqsdk,配置许可证,或者问题应联系RQData技术支持获得帮助
,终止skill的使用
Before using this skill each time, execute
python ~/.claude/skills/rqdata-python/scripts/init_skill.py
. If it returns that the RQData license is unavailable, prompt the user with
You need to correctly install rqsdk, configure the license, or contact RQData technical support for assistance
, and terminate the use of the skill

使用方法

Usage Methods

查找API接口

Finding API Interfaces

  1. 确定所需API文档:在
    cache/api_doc_index.md
    中grep需要的API文档,示例:Grep
    宏观|GDP
    on
    cache/api_doc_index.md
    的结果显示满足GDP宏观数据查询需求的API文档是
    macro-economy.md
  2. 确定所需API接口:在
    cache/api_index/{API文档名}_index.md
    中grep所需API接口。API索引文件中每行表一个API接口的API Name、Description、Line Range,确定匹配API接口的行号List Range,阅读API接口开始的50行来获取API接口定义,如果50行不够多阅读更多行。示例:Grep
    宏观|GDP
    on
    cache/api_index/macro-economy_index.md
    的结果显示满足GDP宏观数据查询需求的API接口是
    econ.get_factors
    ,行号范围是87-131,阅读
    cache/api_index/macro-economy.md
    的第87到87+50行获得API定义
    • 注意也许需要调用多个API接口来满足需求,所以可能需要定位多个API接口
  3. 若以上步骤没有定位到API接口,才尝试在
    cache
    中搜索
  1. Determine the required API documentation: Grep the required API documentation in
    cache/api_doc_index.md
    . Example: The result of grepping
    macro|GDP
    on
    cache/api_doc_index.md
    shows that the API documentation meeting the GDP macro data query requirement is
    macro-economy.md
  2. Determine the required API interface: Grep the required API interface in
    cache/api_index/{API Document Name}_index.md
    . Each line in the API index file represents the API Name, Description, and Line Range of an API interface. Determine the Line Range list of the matching API interface, and read the first 50 lines starting from the API interface to obtain the API definition. If 50 lines are not enough, read more lines. Example: The result of grepping
    macro|GDP
    on
    cache/api_index/macro-economy_index.md
    shows that the API interface meeting the GDP macro data query requirement is
    econ.get_factors
    , with a line number range of 87-131. Read lines 87 to 87+50 of
    cache/api_index/macro-economy.md
    to obtain the API definition
    • Note: You may need to call multiple API interfaces to meet the requirement, so you may need to locate multiple API interfaces
  3. If the API interface is not located through the above steps, try searching in the
    cache
    directory

应使用真实资产代码

Use Real Asset Codes

  • 如果API参数涉及到资产代码(例如股票代码,期货代码,期权代码等),强制获取真实的资产代码:
    • 推断资产类型,资产名称(或资产代码),市场名称
    • 如果是查询期权合约代码请参考
      references/options_contract_query.md
    • 如果是查询期货合约代码请参考
      references/futures_contract_query.md
    • 如果是查询其他类型资产代码参考
      references/common_asset_code_query.md
  • If API parameters involve asset codes (such as stock codes, futures codes, options codes, etc.), mandatorily obtain real asset codes:
    • Infer the asset type, asset name (or asset code), and market name
    • For querying option contract codes, refer to
      references/options_contract_query.md
    • For querying futures contract codes, refer to
      references/futures_contract_query.md
    • For querying other types of asset codes, refer to
      references/common_asset_code_query.md

其他注意事项

Other Notes

  • 如果API参数涉及到宏观因子名称,查询宏观因子名称参考
    cache/api_docs/macro_factor_names.csv
  • 调用RQData API前必须调用
    rqdatac.init()
    来初始化
  • 禁止阅读
    scripts
    中的源代码
  • 当遇到使用问题的时候,参考
    references/pitfall.md
    了解常见错误使用陷阱
  • If API parameters involve macro factor names, refer to
    cache/api_docs/macro_factor_names.csv
    to query macro factor names
  • You must call
    rqdatac.init()
    to initialize before calling the RQData API
  • Prohibited to read the source code in the
    scripts
    directory
  • When encountering usage issues, refer to
    references/pitfall.md
    to learn about common usage pitfalls

Skil执行示例

Skill Execution Example

用户prompt:
请为我展示近几年的中国的存款准备金率
Agent执行步骤:
  1. 强制执行skill初始化脚本
  2. 存款准备金率
    是宏观数据,根据api_doc_index.md,应在
    macro-economy.md
    中查找API
  3. 使用
    macro-economy_index.md
    快速定位满足需求的API接口为
    econ.get_reserve_ratio
    ,行范围87-131
  4. 使用read工具读取
    macro-economy.md
    中读取接口头50行(第87到87+50行)
  5. 从read工具返回中获取API定义和参数信息
  6. 让我开始编写代码
User prompt:
Please show me China's deposit reserve ratio in recent years
Agent execution steps:
  1. Mandatorily execute the skill initialization script
  2. The "deposit reserve ratio" is macro data. According to api_doc_index.md, the API should be found in
    macro-economy.md
  3. Use
    macro-economy_index.md
    to quickly locate the API interface meeting the requirement as
    econ.get_reserve_ratio
    , with a line range of 87-131
  4. Use the read tool to read the first 50 lines (lines 87 to 87+50) of the interface in
    macro-economy.md
  5. Obtain the API definition and parameter information from the return of the read tool
  6. Start writing code