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

It seems that the real-world delay between order submission and order fulfillment should be considered when backtesting. Is it realistic that orders would be filled so quickly and consistently (e.g. submitted one minute and fulfilled the next)? Or should we be thinking about a method like:

order_with_latency(sid,amount,latency)  

Latency would be specified in tics (days or minutes), with order_with_latency(sid,amount,0) equivalent to order(sid,amount). Order fulfillment would be delayed N tics (N > 0) for order_with_latency(sid,amount,N).

An extension would be:

order_with_latency(sid,amount,mean_latency,jitter)  

The jitter parameter would add noise to mean_latency, so that variability in the latency could be captured in the backtest.

Under the paper/live trading to be offered by Quantopian, will there be fixed/variable order fulfillment latency? If so, are any details available yet? How does order fulfillment timing typically work with electronic access brokers (e.g. Interactive Brokers)?

Grant

2 responses

Hi Grant, back from vacation and digging through my unread items!

In general, once you place an electronic order with your broker, it's fulfilled in under a second. The backtester is far more conservative in how long it takes to fill your order. Even if you get a slow fill from your broker (say 1 or 5 seconds), we're still an order of magnitude or two more conservative. You just don't need to be more conservative than the default in most cases.

Of course, if you have an illiquid stock then the behavior is different, but illiquid stocks require a number of careful considerations, not just in order fulfillment. I can see something like what you propose as a package of "illiquid stock" features.

As a broader comment, I'd like to say that we're not building a high-frequency platform here. If someone is writing a strategy where latency matters, they probably shouldn't be trying to write it with our system. Quantopian is aimed at strategies with longer hold times and lower frequencies, and anything that needs second, sub-second, millisecond, or micro-second timing is outside of our target.

Dan

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,

Good information...I didn't realize that orders are typically filled so quickly by electronic access brokers.

Grant