feat(index): 为"历史行情数据-腾讯"接口添加自定义时间范围参数#7241
Open
persist-1 wants to merge 1 commit intoakfamily:mainfrom
Open
Conversation
- 添加 start_date 和 end_date 参数,允许用户获取指定时间范围内的历史数据。 - 更新了对应的文档,以反映新的参数和功能。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动背景
该接口默认返回所有历史数据,如获取上证指数(sz000001),返回的是1990年12月19日至2026年4月29日之间的数据;
而通常来说获取历史数据只需要一次,而之后都是补充数据。比如我获取到2026年4月28日的数据,今天是2026年4月29日,我只需要补充2026年4月29日的数据,而不是返回全部历史数据来进行覆盖(这种方式耗时较多,对目标接口和本地主机都会造成较大负担),所以将该接口改为可获取分时数据,可以更加灵活的使用,且自定义补充数据速度得到极大的提升(比如获取一个月的数据基本上不需要1s,而原先获取历史数据是大约7~9s)。
改动内容
为 stock_zh_index_daily_tx 函数添加自定义时间范围参数
其它说明
关于自定义时间参数(start_date 和 end_date),可自由选择是否填写:
测试效果
测试代码:
打印结果: