API feature request endpoint returning maximum tradable quantity (market order) per symbol / side
Request: a read-only API method that returns the maximum number of shares tradable at market for a given symbol, for both BUY (long) and SELL-SHORT. This is the same figure the mobile app and web terminal already compute for the "max" button on the order ticket, where it already differs between the Buy and Sell sides.
Rationale
Margin requirements are per-symbol and differ for long vs short (e.g. TSLA ~25% long / ~30% short), are only visible in the UI, and change over time. The published margin percentage is not the real effective requirement, and the per-order (initial) requirement differs from the held-position (maintenance) requirement. The true per-side maximum can therefore only be derived from the margin/risk engine, which the API does not currently expose.
The current API (Tradernet / Freedom24 API v2) returns cash via getPositionJson but provides no buying power, no per-symbol margin rate, and no max-quantity field for either side.
Concrete example (TSLA, margin account)
For a LONG, the published margin of ~25% (≈4× leverage) would imply ~100 shares in a single order. In practice the engine accepts only ~84 shares in one market BUY (effective initial requirement ~30%), then allows ~14 more after the fill (~98 total, at ~27% maintenance). The SHORT side carries its own requirement (~30% headline) and therefore a different maximum, equally opaque via the API.
As a result, a full-size position requires two orders, and the only way to discover the cap programmatically today is to submit an order, receive a rejection ("the order may not be accepted: in the worst case scenario … the security level may become critical"), reduce the size, and retry.
Proposed shape
A read-only method, e.g.:
getMaxOrderQty(symbol, side[, account])
where side ∈ {buy, sell}
→ { max_qty, effective_margin_rate }returning the values for a market order and mirroring the "max" button for each side. Exposing the current effective long/short margin rate per symbol would additionally allow correct position sizing in a single step rather than probing with rejected orders.
Good afternoon.
Thank you for your suggestions. We will include it in our near-term plans.
Good afternoon.
Thank you for your suggestions. We will include it in our near-term plans.
Replies have been locked on this page!