Skip to content

之前就如入金了 但是openapi 历史行情配额数量还是不对 #849

@fsankk

Description

@fsankk

问题描述

两月之前就入金了 但是openapi拉取历史行情 还是只能拉取100条

代码例子

    def _build_config(
        self,
        *,
        app_key: str | None,
        app_secret: str | None,
        access_token: str | None,
        region: str | None,
    ) -> Config:
        if app_key and app_secret and access_token:
            # 当前 longport Python SDK 的 Config(...) 不接受 region 参数;
            # region 主要仍通过环境变量/默认配置控制,这里避免显式传入导致 TypeError。
            return Config(app_key=app_key, app_secret=app_secret, access_token=access_token)
        return Config.from_env()


@property
    def quote_ctx(self) -> QuoteContext:
        if self._quote_ctx is None:
            self._quote_ctx = QuoteContext(self.config)
        return self._quote_ctx

 def _quote_call(self, endpoint: str, **params: Any) -> tuple[Any, LongPortRequestRecord]:
        try:
            return self._call(self.quote_ctx, endpoint, **params)
        except Exception as exc:
            if self.quote_fallback_client is None:
                raise
            log_event(
                logger,
                30,
                "longport_quote_fallback_triggered",
                endpoint=endpoint,
                error=str(exc),
            )
            return self.quote_fallback_client._call(self.quote_fallback_client.quote_ctx, endpoint, **params)
return self._quote_call("history_candlesticks_by_date", **kwargs)

错误信息或结果截图

(kind=ErrorKind.OpenApi, code=301607, trace_id=) history kline symbol count out of limit

你的环境信息

  • 操作系统: [比如: macOS /]
  • 开发语言: Python
  • SDK 版本号: py13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions