Interactive brokers trading apis
Any request with a future since date or going further than one week will result in an HTTP bad request response. Allows the consumer to request details regarding a trading product from the IB trading product database. This endpoint allows the consumer to request a market data snapshot for one or more trading products.
The 'market' values are integers whose bits indicate the exchange s making up the quote. Includes a fully worked example; private keys for the example are below.
See section 9 of the OAuth v1. Must be a positive integer and greater than or equal to any timestamp used in previous requests. This URL is provided by the consumer during registration. This parameter must be set to 'oob'. See the "OAuth at Interactive Brokers" document for more details. Allows the caller to request a list of accounts associated with the session. Returns a list of positions held by the account passed in the URL.
Returns a list of orders for the account passed in the URL. Ticker The symbol that identifies the trading product. Quantity The number of units in the order; contracts or shares. Price The order price. If more than one restriction is applicable to an order, this field can contain multiple instructions separated by space. See OrderRestricions GermanHftAlgo false By setting this bool to false the customer attests that the order is not subject to German HFT Act, was not generated using any automated algorithm, and no algorithm determined or changed financial instrument, side, quantity, order type, limit or other price, trading venue or timing of this order.
Mifid2Algo This field permits specification of the user's preregistered via account management MiFID II short code for algos that are responsible for investment decisions. IB only supports changing a Limit order to a Market order. Must match the original order. The character hexadecimal string that was obtained from Interactive Brokers during the OAuth consumer registration process.
Challenge value calculated using the Diffie-Hellman prime and generated provided during the registration process. One institutional client that we helped implement an automated trading model through the API now trades around one million shares a day with it.
Apart from those who connect to us directly via API we also do significant business with brokers. Of this, omnibus account business where the broker handles the client accounting is probably also generating additional API activity. An important additional channel of API activity for us is the third-party vendor market.
These vendors have the confidence to invest in writing to the IB API because it has been around for a long time and is regularly maintained and upgraded. Traders without programming skills wishing to implement their ideas as automated models are thus able to do so with the aid of these consultants. If they have limited programming skills, apart from the documentation we provide, a great way to understand how to use the API is to take a look at the activity on GitHub.
We've recently open-sourced the API and uploaded it there, so traders have an opportunity to collaborate and exchange code, as well as enhance the API in the open source environment. Apart from benefiting even experienced programmers, that's also a valuable initial learning resource. Plus of course there are also our webinars. The option of standard FIX connectivity is understandably of primary interest to our institutional users.
There are two ways in which they can implement this, either via a dedicated connection direct to our servers, or over the Internet. In the latter case, the connection is made via an application called the IB Gateway, which simply handles authentication and passes the data through. Pretty much as you might expect. Higher trade volumes per customer than for manual traders and the general style of trading tends to be akin to market making, with relatively small size being shown. Particularly if it's something fairly obscure, we don't automatically add every new piece of Trader Workstation functionality to the API.
That sort of item is only added if specifically requested. The usual routine is to add functionality to the Trader Workstation first and then to the API, though sometimes it is added simultaneously. If for example a new exchange comes online, then that will automatically be available on the API. The same applies to individual financial products.
The exception to this is if a new type of data is associated with orders for that instrument. If that could not be fitted into the existing data fields then it would require additional programming to update all the various API clients.
So although they have to be written in different languages, the format of the messages are just the same and the same basic parameters and methods are used.