36

I'll just add that with Interactive Brokers you have to be aware of their cancel fees. Remember, Interactive Brokers owns Timber Hill, a very large and active market maker. They will discourage you from competing with Timber Hill through monetary disincentives, among other things. For example, if you send a directed order (i.e., you don't allow IB to SMART ...


9

Pete's seven year old answer is just as relevant now as it was in 2011. None of the limiting factors of their API has changed since then, so this is essentially an extensive reiteration. The Interactive Brokers API is not suitable for high frequency trading execution. However the main reason that this is the case is not necessarily what would come to mind ...


7

The demo account sends simulated data, not delayed data. It is unusable for just about anything except to see if your connections are working. The paper account sends real time data if you subscribe to it and pay data fees. It has all the functionality of a real account except fills are simulated. I believe it's worst case fills as in you have to trade ...


6

The IB website have a demo version of TWS for download which you can use with their C++, Java etc API. The price feed is stale and orders are not cleared but it shouldn't matter for your purposes. The demo version doesn't require a account/username. There are also active groups which can be very helpful for details on IB API. One large group is, for ...


5

IB has something called "Flex Web Service", which allows you to download flex queries without being logged in; see Using the Flex Web Service. The R package IButils, which I maintain, has a function flex_web_service, which allows you to download queries. In R, you could write: library("IButils") flex_web_service(file = "~/my_files/my_report.csv", ...


4

Data over IB's API is not real time. You can't even match up bid, asks, and lasts with their appropriate sizes. It's actually a 200 ms snapshot. For more reliable data go with B-PIPE, DTN or eSignal (they all have APIs) and a high speed co-located Ethernet or T1 connection to your vendor. Lots of additional coding is required.


4

After some research and reading the source, I found there is a field in the Contract class called: m_includeExpired. Set this to True and you can get data for expired contracts.


4

The function reqHistoricalData has an argument useRTH ("use regular trading hours"). Set useRTH = "0" to get data outside those hours. This can only work for the futures, not for the index, which is only computed during normal trading hours. library("IBrokers") tws <- twsConnect() contract <- twsContract(local = "ESH9", ...


3

Here is a pure Java library with Matlab examples for getting daily and minute aggregated bars. It is based on IB Java API. I wrapped it to have a simple interface: http://www.spreadvectors.com/wisentgenus#code IB has limitations when requesting historical data: Making identical historical data requests within 15 seconds. Making six or more historical ...


3

I think what you are looking for is an Adjustable Stop Orders (https://www.interactivebrokers.com/en/index.php?f=574). Using adjustable-stop-order you can limit your losses in case the price falls and protect your profits if the price rises. Adjustable stop orders are not orders per say but they are "instructions" to change an existing order. For example: ...


3

Here is a list of vendors connected to OPRA directly who can supply such data. http://www.opradata.com/related_info/vendor_list.jsp Like yourself I looked at Xignite. They have a nice REST API, though not streaming. But pricing is such that it is clear they only want to cater to institutions. Btw, with a $30K budget you can probably become a Tier1 quote ...


3

Some time ago I tested the IB C++ API with the free demo account: edemo-demouser. The market data is obviously far from reality, but its fine for getting to know the API itself. Good luck with your project!


3

TradeStation offers python support via their WebAPI. Check it out here: http://tradestation.github.io/webapi-docs/


3

Remember that all back testing is full of lies assumptions. Latency (both line latency and latency internal to the exchanges), adverse selection, market impact (yes, even you have market impact), etc, are all based on assumptions. These assumptions are educated guesses at best, but more often terrible models are used (you always get filled at at mid!) and ...


2

I know of no broker that provides an official, supported Python API. If you are at Interactive Brokers you can consider using their FIX gateway, but that comes with additional cost. QuickFix provides a Python API.


2

Don't try to capture LIVE tick data using a WebApp. I'm not saying it can't be done, I'm just saying you would get zero benefits and you would have to work way harder to make it functional. Web servers are designed with a premise, serve the user the requested data as fast as possible and free that resource up. You would have to fight the server logic (as ...


2

Interactive Brokers does not offer historical data on expired options. All IV calculations must be derived from options that have not expired yet. I believe historical volatility is calculated from the underlying security, and implied volatility is calculated from the option premium. IB's API has a routine called calculateImpliedVolatility(). Never used ...


2

At AlgoTrader we also use Esper to store all arriving Tick Data in a local Esper Named Window. After a predefined interval, the latest Tick Data snapshot is written to both the filesystem and the database. The actual persistence is done in a separate thread by using Esper Threading. Currently we use MySql but you could just as well use some NoSQL Database (...


2

IB does not offer tick data. They consolidate their data every 0.3 seconds or so. If you want to store your data temporarily for import into another system later on, then just store it as a CSV file. Personally I use IQFeed to download tick data into SQL Server which I then use to run analyses on. When I need to run multiple test runs on the same data, ...


2

I am planning on using a complex event processing platform such as Esper or StreamBase to handle the incoming tick data to generate buy/sell events. The tick data would also be be forwarded through a queue (0MQ or RabbitMQ) to be written to a datastore (file or SQL database). By doing so, I have the data necessary to backtest or analyze in R or MATLAB, ...


2

You can fund the account with the minimum account requirement for setup, then withdraw your funds immediately. You will then only need enough in your account to cover monthly data usage fees. (You don't have to maintain an account minimum to keep the account open.) It's not an ideal solution but you may be able to borrow the funds off a family member for a ...


2

Don't use either DDE or ActiveX, go with the excel RTD server api. It's the basis behind the Bloomberg BDP plugin and we use it at work to push real time data to many spreadsheets.. It's now the recommended way to push data into a spreadsheet and it has a built in refresh rate parameter which can be any millisecond interval, or immediate if you want data ...


2

You'll want the ibrokers package, its very good and built on the c++ api. Also check out quantmod, performanceanalytics, and highfrequency package. And a comprehensive list, http://cran.r-project.org/web/views/Finance.html


2

ES is supposed to update every 100 msec now in TWS. I imagine the FOPs update slower than that, probably every 300 msec. IB is not a real time feed like others, they aggregate the data and send it on schedule. It's good because it doesn't lag, bad because you don't get every tick. What Matt said is true and good but if you want to stick with Excel you ...


2

Answer to question of IB Gateway using other server IB Gateway reads a "jts.ini" file to determine which server it should connect to. There is a "[communication]" section under which a "peer=" value is set. When I download IB Gateway from the IB US website the provided default jts.ini file contains: [communication] peer=gw1.ibllc.com:4000 Depending on ...


2

Just checked in my python script for daily futures data from Interactive Brokers. Maybe it will be useful for you: https://github.com/busygin/ib_data_loader


2

The IB API calls your code asynchronously when there are account updates after you have called reqAccountUpdates. But you have to provide a callback function (handler) for the IB API to call. Looks like from the [ibPy documentation example] (https://code.google.com/p/ibpy/wiki/IbPyOptional) and how the Java IB API is defined, you want to call tws.register(...


2

You would create an "Alert" that submits the trailing order when some set of market conditions are met. It's confusing because this is really a trigger, but IB calls it an alert.


2

Edit (2016-06-21): Now with live data/trading integration with Interactive Brokers. It has taken a while but it has finally arrived. backtrader (https://github.com/mementum/backtrader) can do 1 and 3 and is in the process of getting 2 ironed out. A live data feed from IB will make it into the next release (due in the next few days) and it will then be down ...


2

I've used both approaches at different points of my career, and both are valid. Firstly, there's a few statements that aren't quite correct. ...AND in a file on disk in order to avoid losing all data if the program crashes. ... have the TWS API receiving asynchronous data feed and append the data in a flat/binary file in the system. Multiple It ...


Only top voted, non community-wiki answers of a minimum length are eligible