Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
live data feed?

This is a follow-on from https://www.quantopian.com/posts/timeframes-discussion. I'm doing a new post, to give some visibility to the question (originally posed by Peter Cawthron).

Presumably, Interactive Brokers (IB) will be providing a low-latency minute-level OHLCV data feed (and it would seem that the data would need to come from IB, since they will be on the hook for filling orders at prices that relate directly to the trailing data). Or perhaps feeds at multiple frequencies will be available, for which an "event driven" algo would be capable of triggering off of each independently (sychronously? asynchronously?)? Will the data be datetime stamped at even minute intervals, as they are now?

What's the game plan with respect to the live trading data stream?

8 responses

Grant, for live trading we're using Nanex's NxCore as a data feed. They are feeding us the data on trades, and we are constructing the OHLCV minute bars from that trade data.

When you run a papertrading algo, that's exactly what's going on. NxCore trades are going into our system and minute bars are being emitted to the algos. Your papertrading algo is on a 15-minute delay (it's far far cheaper than the live data, and we pay per user!). But your papertrading algo is getting the exact same data the live algos are getting. Yours has just been cooling in the database for a few minutes.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Thanks Dan,

Interesting...I would have thought you'd get the feed from Interactive Brokers (IB) for live trading. I don't understand the whole issue of timing and consistency between the prices you construct and the order fulfilment at IB. If Quantoopian feeds a price, how is that price related to the eventual price paid, if I submit an order? I'd think that the prices should be quoted by the same folks filling orders, to make sure everything stays in synch and is consistent.

Grant

It's not the most intuitive solution - the natural assumption is that you get your prices from the same group that you place your orders. But in this case, when you tease out the component parts, it turns out not to matter that the price and order functions are separate.

No one can quote the bids and ask prices with perfection - that's the whole space that high-frequency trading is. Orders are being placed and cancelled and filled faster than than the electrons can leave the server room. The prices that IB is quoting are, inherently, out of date, but they're obviously "close enough" for someone to place orders. There is enough information to make decisions, even if it isn't perfect. Similarly, Quantopian is working on these minute bars - it's not perfect information about the market condition, but it's enough information to make buy and sell decision.

Another part of this to think about is that really, IB isn't the other party in your transaction. IB is (largely) the middleman. IB is reporting on the state of the market. NxCore is reporting on the state of the market. Neither of them actually is the buyer/seller. In that light, there's nothing magical or special about IBs role in the price. IB is just the runner who takes your order to the place where your order is actually filled.

Then, add a technical wrinkle. IB only lets you look at a few dozen prices at a time through their API, while NxCore lets you look at the whole market (yes, Quantopian is limiting how much you can look at at once, but we plan on removing that limit as our performance improves). At that point, NxCore is a superior price solution for our purposes.

Thanks Dan,

Makes sense. If, in the end, you can offer more that IB is offering as a data feed, and have a zippy analysis tool, then it sounds like a win.

Grant

Yeah, the real value-add would be if Quantopian can relieve the burden of developing a execution infrastructure, risk-management infrastructure, dynamic bet sizing models and dynamic inter-system capital allocation models, letting people focus on their alpha models and largely plug-and-play the rest. Debugging feedback between fills, partial fills, delayed fills, delayed cancels, current portfolio state and desired portfolio state is the tedious stuff that nobody wants to do.

Though I suppose that might expose Quantopian to unwelcome liability if there were defects in those plug-ins. On the other hand, I guess they're already putting themselves in that position...

Thanks Simon,

Presumably, data from IB will be available to Quantopian algorithms. Is this detailed anywhere, along with the associated latencies? If I understand your comments correctly, Quantopian will need to have real-time data fed back from IB and ideally provide some helper methods for managing it.

Grant

Hello Grant,

Obviously trading with IB through Quantopian will require an IB account. They do provide an API and there are Open Source efforts at using this API via Python, namely https://code.google.com/p/ibpy/

As an aside, at Stack Exchange I read variously that the IB API updates prices six or seven times a second or that it is a 200ms window of prices (http://quant.stackexchange.com/questions/325/is-the-interactive-brokers-api-suitable-for-hft). I'm not sure how 1 minute events map onto this.

P.