Skip to content

v5.2.0

Choose a tag to compare

@wboayue wboayue released this 20 Oct 17:21
· 67 commits to main since this release
37a7e96

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 return Error::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 in next(), which yield Err(Error::Cancelled) instead of hanging.

Order routing with multiple clients (#1021, #1033)

  • Another client's OpenOrder/OrderStatus frames no longer reach this client's place_order subscriptions, order_update_stream, wait_for_fill or order_status_stream (order ids are unique per client only). They go to all_open_orders. With a master client id, use all_open_orders and executions for other clients' orders.
  • open_orders, all_open_orders and auto_open_orders include orders that have a live place_order subscription.

Reconnect

  • After a reconnect, wait_for_fill no 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_type survives 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 with Error::Timeout after 30s instead of blocking forever; request_fa and market_rule return the dataset/rule they asked for under concurrency. Thanks to @tradatious for the contribution (#1029).
  • The blocking client no longer warns error sending notification for 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.