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

Aperta
#1,211 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
openapi, python
Ambito
api

Direzione di ricerca

Parti dal punto di ingresso us_query_orders() del Python SDK e verifica come viene prodotta ed esposta la relativa OpenApiException. Confronta la chiamata che fallisce con le chiamate PAPER di sola lettura elencate che hanno esito positivo, quindi verifica il limite di entitlement supportato e il codice di errore del broker. Il lavoro è completato quando il risultato non supportato o non autorizzato è documentato e il codice di errore rimane disponibile per i client.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
61
Fork
30
Merge medio
7h 27m
PR unite (30g)
19

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di longbridge/developers

Tutte le issue di longbridge/developers

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.