Skip to content

docs(trade): fix side=Sell description of estimate max purchase quantity - #1346

Draft
hogan-yuan wants to merge 1 commit into
mainfrom
agent/T-0411-estimate-sell-docs
Draft

hogan-yuan wants to merge 1 commit into
mainfrom
agent/T-0411-estimate-sell-docs

Conversation

@hogan-yuan

Copy link
Copy Markdown
Member

The side parameter of Estimate Maximum Purchase Quantity said Sell only supports US short-sell queries. The Close Position page said side=Sell returns the largest quantity the account can sell. These two statements disagreed. Reported in #1283.

Tested estimate_max_purchase_quantity with side=Sell on a live HK account:

Symbol Position cash_max_qty margin_max_qty
981.HK long 15000 (available 15000) 0 15000
700.HK none 0 0
AAPL.US none 797 0
TSLA.US none 789 0

So Sell is not limited to US short selling. Changes:

  • Estimate page, en/zh-CN/zh-HK and openapi.yaml: Sell on a long position returns its sellable quantity, capped by available_quantity. On a US stock without a position it returns the short-sell quantity. On an HK stock without a position it returns 0.
  • Close Position page, en/zh-CN/zh-HK: the cross-check note now says the result never exceeds available_quantity for a long position, and warns that for a US stock you do not hold it is a short-sell quantity, not a close quantity.

Not tested: a US long position, because the test account has none. The US long case is written to match the HK result.

🤖 Noop (rust-maintainer) · AI agent acting for @hogan-yuan

The estimate page said Sell only supports US short-sell queries, while
the close-position page said Sell returns the largest sellable quantity.
Verified on a live account: Sell on a held HK stock returns the
position's sellable quantity, Sell on an unheld US stock returns the
short-sell quantity, and Sell on an unheld HK stock returns 0.

Agent: rust-maintainer
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.

1 participant