Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

获取历史K线报错 longport.OpenApiException: OpenApiException: (500000) internal error #8

Open
ZhengxuYu opened this issue Dec 17, 2023 · 2 comments

Comments

@ZhengxuYu
Copy link

运行doc中的样例代码报错。
doc中的样例如下:

# 获取标的历史 K 线
# https://open.longportapp.com/docs/quote/pull/history-candlestick
#
# 运行前请访问“开发者中心”确保账户有正确的行情权限。
# 如没有开通行情权限,可以通过“LongPort”手机客户端,并进入“我的 - 我的行情 - 行情商城”购买开通行情权限。
from datetime import date
from longport.openapi import QuoteContext, Config, Period, AdjustType

config = Config.from_env()
ctx = QuoteContext(config)

resp = ctx.history_candlesticks_by_offset("700.HK", Period.Day, AdjustType.NoAdjust, false, date(2023, 1, 1), 10)
print(resp)

其中false写错了,改正后报错

    from datetime import date
    from longport.openapi import QuoteContext, Config, Period, AdjustType

    config = Config.from_env()
    ctx = QuoteContext(config)

    resp = ctx.history_candlesticks_by_offset("700.HK", Period.Day, AdjustType.NoAdjust, False, date(2023, 1, 1), 10)
    print(resp)

报错信息:

    ctx = QuoteContext(config)
longport.OpenApiException: OpenApiException: (500000) internal error
@ZhengxuYu
Copy link
Author

大佬们帮忙看看为什么?

@huacnlee
Copy link
Contributor

可能是偶发的错误,你现在还有这个问题吗

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

No branches or pull requests

2 participants