Skip to content

Conversation

@rootphantomer
Copy link

@rootphantomer rootphantomer commented Jul 4, 2023

修复 #130 这个 issue

原因:

当 低于 klt 低于 101 的时候,如 60,30 分钟线,触发的是以下 get 请求
http://35.push2his.eastmoney.com/api/qt/stock/kline/get?secid=1.600900&fields1=f1%2Cf2%2Cf3%2Cf4%2Cf5%2Cf6&fields2=f51%2Cf52%2Cf53%2Cf54%2Cf55%2Cf56%2Cf57%2Cf58%2Cf59%2Cf60%2Cf61&klt=30&fqt=1&end=20500101&lmt=100

根据 url 分析,东方财富要求有个 lmt 参数(limit),同时 beg 和 end 参数不可自选,end 只能取默认最大值 20500101,通过改变 lmt 可以更改近几日的分钟线。目前 lmt 默认是 100

测试 30 分钟线

df = ef.stock.get_quote_history("600900", beg="20200101", end="20230101", klt=30, fqt=1,lmt=100)

可返回结果:
image

新增:

ef.stock.get_quote_history 可以传入 lmt 值来控制返回的数量

@xyz2abc-fintech
Copy link

http://35.push2his.eastmoney.com/api/qt/stock/kline/get?secid=1.600900&fields1=f1%2Cf2%2Cf3%2Cf4%2Cf5%2Cf6&fields2=f51%2Cf52%2Cf53%2Cf54%2Cf55%2Cf56%2Cf57%2Cf58%2Cf59%2Cf60%2Cf61&klt=30&fqt=1&end=20500101&lmt=100 中, 设定lmt=500时,只能获取有限数据(大约是250条左右)。不是说不能获取到数据,而是获取的数据条数过少,导致无法进行使用。

@rootphantomer
Copy link
Author

http://35.push2his.eastmoney.com/api/qt/stock/kline/get?secid=1.600900&fields1=f1%2Cf2%2Cf3%2Cf4%2Cf5%2Cf6&fields2=f51%2Cf52%2Cf53%2Cf54%2Cf55%2Cf56%2Cf57%2Cf58%2Cf59%2Cf60%2Cf61&klt=30&fqt=1&end=20500101&lmt=100 中, 设定lmt=500时,只能获取有限数据(大约是250条左右)。不是说不能获取到数据,而是获取的数据条数过少,导致无法进行使用。

原因见:#132 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants