Repository navigation
v5.2.0
5.2 makes wait_for_fill find orders this connection hasn't seen, keeps other clients' order frames out of this client's order routes, fixes async Subscription clones hanging on drop or cancel, and adds TWS API 1051.01 fields. No breaking changes.
What's New
wait_for_fill finds orders from earlier connections (#993, #1020)
On an order this client has no status for, wait_for_fill now asks TWS for this client's open orders, then falls back to completed_orders. A still-working order placed on an earlier connection is found instead of timing out, and one that already finished ends at once with Filled or Ended (fill prices None).
New examples/{sync,async}/wait_for_bracket.rs waits for every leg of a bracket with three wait_for_fill calls sharing one deadline.
TWS API 1051.01 fields (#1045)
ContractDetails::settlement_method:"Physical"or"Cash".Order::conditions_include_overnight: evaluate conditions during the OVERNIGHT session. Needs server 226; older servers returnError::ServerVersion. The client now advertises max server version 226.
Bug Fixes
Async Subscription clones (#1047, #1049)
- Dropping one clone no longer cancels the request for the others; the last drop cancels. Previously remaining clones waited forever.
cancel()wakes clones parked innext(), which yieldErr(Error::Cancelled)instead of hanging.
Order routing with multiple clients (#1021, #1033)
- Another client's
OpenOrder/OrderStatusframes no longer reach this client'splace_ordersubscriptions,order_update_stream,wait_for_fillororder_status_stream(order ids are unique per client only). They go toall_open_orders. With a master client id, useall_open_ordersandexecutionsfor other clients' orders. open_orders,all_open_ordersandauto_open_ordersinclude orders that have a liveplace_ordersubscription.
Reconnect
- After a reconnect,
wait_for_fillno longer trusts a working order's cached status; it looks the order up again, so a fill during the outage isn't missed (#1031). - The market data type set with
switch_market_data_typesurvives an automatic reconnect. Thanks to @tradatious for the contribution (#1016).
Also fixed
- One-shot requests on a shared channel (
managed_accounts,server_time,family_codes,request_fa,next_valid_order_id, ...) fail withError::Timeoutafter 30s instead of blocking forever;request_faandmarket_rulereturn the dataset/rule they asked for under concurrency. Thanks to @tradatious for the contribution (#1029). - The blocking client no longer warns
error sending notificationfor a subscription dropped just before shutdown (#999).
Examples
Drifted examples renamed: v2_contract_builder → contract_builders, *_midpoint → *_mid_point, async_test_clone_subscription → async_subscription_fan_out; async_test_multiple_calls removed; async_historical_ticks_mid_point no longer fails with error 10187. Thanks to @tradatious for the report (#1041).
See CHANGELOG.md for the full list.
Thanks to @tradatious for the many internal cleanups in this release (#1001–#1005, #1008, #1009, #1012, #1013, #1015, #1023–#1027, #1037–#1040, #1042–#1044), and to @adityamukesh for #1011.