rqdata-python
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineserqdata-python
rqdata-python
每次skill使用前,执行。如果返回RQData license不可用,则提示用户,终止skill的使用
python ~/.claude/skills/rqdata-python/scripts/init_skill.py需正确安装rqsdk,配置许可证,或者问题应联系RQData技术支持获得帮助Before using this skill each time, execute . If it returns that the RQData license is unavailable, prompt the user with , and terminate the use of the skill
python ~/.claude/skills/rqdata-python/scripts/init_skill.pyYou need to correctly install rqsdk, configure the license, or contact RQData technical support for assistance使用方法
Usage Methods
查找API接口
Finding API Interfaces
-
确定所需API文档:在中grep需要的API文档,示例:Grep
cache/api_doc_index.mdon宏观|GDP的结果显示满足GDP宏观数据查询需求的API文档是cache/api_doc_index.mdmacro-economy.md -
确定所需API接口:在中grep所需API接口。API索引文件中每行表一个API接口的API Name、Description、Line Range,确定匹配API接口的行号List Range,阅读API接口开始的50行来获取API接口定义,如果50行不够多阅读更多行。示例:Grep
cache/api_index/{API文档名}_index.mdon宏观|GDP的结果显示满足GDP宏观数据查询需求的API接口是cache/api_index/macro-economy_index.md,行号范围是87-131,阅读econ.get_factors的第87到87+50行获得API定义cache/api_index/macro-economy.md- 注意也许需要调用多个API接口来满足需求,所以可能需要定位多个API接口
-
若以上步骤没有定位到API接口,才尝试在中搜索
cache
-
Determine the required API documentation: Grep the required API documentation in. Example: The result of grepping
cache/api_doc_index.mdonmacro|GDPshows that the API documentation meeting the GDP macro data query requirement iscache/api_doc_index.mdmacro-economy.md -
Determine the required API interface: Grep the required API interface in. 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
cache/api_index/{API Document Name}_index.mdonmacro|GDPshows that the API interface meeting the GDP macro data query requirement iscache/api_index/macro-economy_index.md, with a line number range of 87-131. Read lines 87 to 87+50 ofecon.get_factorsto obtain the API definitioncache/api_index/macro-economy.md- Note: You may need to call multiple API interfaces to meet the requirement, so you may need to locate multiple API interfaces
-
If the API interface is not located through the above steps, try searching in thedirectory
cache
应使用真实资产代码
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 to query macro factor names
cache/api_docs/macro_factor_names.csv - You must call to initialize before calling the RQData API
rqdatac.init() - Prohibited to read the source code in the directory
scripts - When encountering usage issues, refer to to learn about common usage pitfalls
references/pitfall.md
Skil执行示例
Skill Execution Example
用户prompt:
请为我展示近几年的中国的存款准备金率Agent执行步骤:
- 强制执行skill初始化脚本
- 是宏观数据,根据api_doc_index.md,应在
存款准备金率中查找APImacro-economy.md - 使用快速定位满足需求的API接口为
macro-economy_index.md,行范围87-131econ.get_reserve_ratio - 使用read工具读取中读取接口头50行(第87到87+50行)
macro-economy.md - 从read工具返回中获取API定义和参数信息
- 让我开始编写代码
User prompt:
Please show me China's deposit reserve ratio in recent yearsAgent execution steps:
- Mandatorily execute the skill initialization script
- The "deposit reserve ratio" is macro data. According to api_doc_index.md, the API should be found in
macro-economy.md - Use to quickly locate the API interface meeting the requirement as
macro-economy_index.md, with a line range of 87-131econ.get_reserve_ratio - Use the read tool to read the first 50 lines (lines 87 to 87+50) of the interface in
macro-economy.md - Obtain the API definition and parameter information from the return of the read tool
- Start writing code