Python PAPER: document US order-query eligibility and preserve the broker error code

オープン
#1,211 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
静か
技術スタック
openapi, python
領域
api

調査の方向性

Python SDK の us_query_orders() エントリーポイントから開始し、その OpenApiException がどのように生成され、公開されるかを確認します。失敗する呼び出しを、一覧にある成功する読み取り専用の PAPER 呼び出しと比較し、その後、サポートされている entitlement の境界と broker のエラーコードを検証します。サポート対象外または認可されていない結果が文書化され、エラーコードがクライアントから引き続き利用可能であれば完了です。

索引モデルが issue の本文から書いたものです。

説明

documentation question

Summary

The generic Python PAPER trade surfaces are readable, but the US-specific order query raises OpenApiException. The supported entitlement and error-code boundary is unclear.

Environment

  • Longbridge Python SDK: 4.5.0
  • Python: CPython 3.12
  • Operating system: Windows
  • Account environment: PAPER
  • Broker mutations performed: None

Reproduction

Using one PAPER configuration with enable_papertrading=True:

Successful read-only calls
  • account_balance()
  • stock_positions()
  • today_orders()
  • history_orders()
  • the read-only DCA plan-list call
Failing read-only call
TradeContext.us_query_orders(
    start_at=1,
    end_at=current_epoch,
    query_type=0,
    page=1,
    limit=20,
)

This call raises OpenApiException.

No order or account mutation is involved. The same credential can read the generic PAPER trade surfaces listed above.

Questions

  1. Is us_query_orders() restricted to a US-data-center account, rather than an AP/PAPER account that can trade US symbols?
  2. Is there a supported read-only capability or region endpoint that clients should call before invoking the US-specific order API?
  3. Which broker error code should represent this entitlement mismatch?
  4. Should the Python SDK expose that error code reliably on OpenApiException?

Desired outcome

Clients should be able to classify this result as unsupported or unauthorized, rather than incorrectly interpreting it as an empty order inventory.

Credentials, account identifiers, trace IDs, and historical order IDs are intentionally omitted.

主要言語
TypeScript
スター
61
フォーク
30
平均マージ
7時間 27分
マージ済み PR(30日)
19

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

longbridge/developers のほかの issue

longbridge/developers の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。