API Release Notes Build 9.40

API Beta Notes

The enhancements and modifications below are in build 9.40 of the TWS API. This API release requires TWS server version 38 (TWS release 878). Please note that API 9.4 will disconnect immediately if a TWS version older than 878 is detected. Noted features below require TWS version 879.

For clarification on any of the items listed, refer to the appropriate section in the Users Guide, or send us an email at Beta Support.

View "What-If" Margin & Commissions before Transmitting an Order

Supported in: Socket and ActiveX APIs

You can now request margin and commission "what if" data on an order before you transmit. In support of this feature, a new attribute, bool whatIf(), was added to the Order class. When this value is set to true, margin and commission data is received back via a new OrderState() object for the openOrder() callback.

Commissions Relayed to API for Each Trade

Supported in: Socket and ActiveX APIs

The openOrder() callback with the new OrderState() object will now be invoked each time TWS receives commission information for a trade.

Contract and ContractDetails Classes/Structs Reorganized to be More Intuitive

Supported in: Socket APIs

Deprecated Advisor-Related Property Removed

Supported in: Socket and ActiveX APIs

The previously deprecated Order::sharesAllocation property has been removed. You must now use the faGroup, faProfile, faMethod and faPercentage fields to support advisor functionality.

ActiveX Redesigned to Mimic Socket Interfaces

Supported in: ActiveX API

We have significantly refactored the ActiveX control to mimic the Socket interfaces. For each class (struct) we now have a COM interface (object) with the same set of properties, which is being passed to a corresponding request (callback). This replaces a callback method that takes 70+ parameters with a callback method that takes a couple of objects, and allows us to support all of the available API features for VB6 clients.

The following "Ex" requests have been added (dispinterface _DTws):

[id(100)] void reqContractDetailsEx(IContract* contract);
[id(101)] void reqMktDataEx(LONG tickerId, IContract* contract, BSTR genericTicks, BOOL snapshot);
[id(102)] void reqMktDepthEx(LONG tickerId, IContract* contract, LONG numRows);
[id(103)] void placeOrderEx(LONG orderId, IContract* contract, IOrder* order);
[id(104)] void reqExecutionsEx(IExecutionFilter* filter);
[id(105)] void exerciseOptionsEx(LONG tickerId, IContract* contract, LONG exerciseAction, LONG exerciseQuantity, BSTR account, LONG override);
[id(106)] void reqHistoricalDataEx(LONG tickerId, IContract* contract, BSTR endDateTime, BSTR duration, BSTR barSize, BSTR whatToShow, BOOL useRTH, LONG formatDate);
[id(107)] void reqRealTimeBarsEx(LONG tickerId, IContract* contract, LONG barSize, BSTR whatToShow, BOOL useRTH);
[id(108)] void reqScannerSubscriptionEx(LONG tickerId, IScannerSubscription* subscription);

The following "Ex" callbacks have been added (dispinterface _DTwsEvents):

[id(100)] void contractDetailsEx(IContractDetails* contractDetails);
[id(101)] void openOrderEx(LONG orderId, IContract* contract, IOrder* order, IOrderState* orderState);
[id(102)] void execDetailsEx(LONG orderId, IContract* contract, IExecution* execution);
[id(103)] void updatePortfolioEx(IContract* contract, LONG position, DOUBLE marketPrice, DOUBLE marketValue, DOUBLE averageCost, DOUBLE unrealizedPNL, DOUBLE realizedPNL, BSTR accountName);
[id(104)] void scannerDataEx(LONG reqId, LONG rank, IContractDetails* contractDetails, BSTR distance, BSTR benchmark, BSTR projection, BSTR legsStr);

Note: Non-Ex counterparts of the requests/callbacks above have been deprecated and will be removed soon. Clients are urged to update their software to use the new interface.

The following factory methods have been introduced (dispinterface _DTws):

[id(200)] IContract* createContract(void);
[id(201)] IComboLegList* createComboLegList(void);
[id(202)] IOrder* createOrder(void);
[id(203)] IExecutionFilter* createExecutionFilter(void);
[id(204)] IScannerSubscription* createScannerSubscription(void);

Note: The factory methods listed above are the only supported way to create newly introduced I* COM objects.

Note: Once created by a factory, COM objects are tied to a corresponding TWS COM object. Do not try to pass them to another TWS COM objects instance, as this might cause undefined behavior.

New scannerDataEnd() Method Added to Define Full Data Snapshot

Supported in: Socket and ActiveX APIs

A new method, scannerDataEnd(int reqId), is called once a full snapshot of a scanner window is received. This "end" tag helps to define the end of one scanner snapshot and the beginning of the next.

OutsideRTH Flag Replaces "Ignore Regular Trading Hours" and "Regular Trading Hours Only" Flags

Supported in: All API Platforms

A new, single order atttibute, bool OutsideRTH(), replaces two flags: ignoreRTH and rthOnly in the Order class/struct. If set to true, this new extended order attribute allows orders to trigger or fill outside of regular trading hours.

IBExecution Customers: Away and PTA Orders Supported (requires TWS 879)

Supported in: Socket and ActiveX APIs

Two new extended order attributes have been added in support of IBExecution customers:

© 2001 Interactive Brokers LLC. All rights reserved. Sun, Sun Microsystems, the Sun Logo and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. Excel is a trademark or registered trademark of Microsoft Corporation in the United States and/or other countries.