OrderBookClient as signed requests; tpluspy handles the Ed25519 signing automatically. All prices and quantities travel as integers in the book’s native units — you must scale your human-readable amounts using the decimal information provided by the Market object before sending an order.
Quantities and Prices: Integer Book Units
Every on-the-wire quantity and price is an integer. The book’s decimal precision is specific to each market and is exposed through theMarket object returned by get_market().
If you want to place a limit order at a human-readable price of
1.50 and book_price_decimals is 6, the integer price you send is 1_500_000. Always derive decimals from the Market object — do not hardcode them.Limit Orders
A limit order rests on the book at a specified price until it is filled, cancelled, or its time-in-force expires. Import the time-in-force classes fromtplus.model.limit_order:
Time-in-Force Options
GTC — Good Till Cancelled
Rests on the book indefinitely until fully filled or explicitly cancelled. The default choice for passive market-making.
GTD — Good Till Date
Rests on the book until fully filled, cancelled, or the specified expiry timestamp is reached.
IOC — Immediate Or Cancel
Attempts to fill immediately against existing resting orders. Any unfilled portion is cancelled instantly — nothing rests on the book.
Placing Limit Orders
Market Orders
A market order executes immediately at the best available price(s) on the book. There is no price parameter — quantity and side are sufficient.fill_or_kill=True if you need the entire quantity filled in a single sweep or not at all.
Order Lifecycle
Partial Fill
Resting orders may be partially filled as matching orders arrive. The unfilled quantity remains on the book (for GTC/GTD). Stream order events to track partial fills in real time:
Querying Orders
Batch Order Submission
Send multiple order requests in a single round-trip withsend_multiple_orders. This is particularly useful for market-making strategies that need to update an entire quote sheet atomically:
Error Handling
T+ raises specific exceptions for order-related failures. Import them from the top-leveltplus package:
OrderRejected
The exchange accepted the request but rejected the order — for example, an invalid price, insufficient margin, or a duplicate order ID. Check
err.message for the rejection reason.OmsError
A non-rejection error from the order management system — for example, trying to cancel an order that no longer exists. Usually indicates a state mismatch between your client and the exchange.
RateLimitError
You have exceeded the request rate limit. Back off and retry.
AuthError
The request signature was rejected. Ensure you are using the correct
User object associated with the account that owns the order.CLI Equivalent
Every order operation is also available through thetplus orders CLI: