Back

How do I get bid/ask data. I am trading with IB.

I am trying a paper trade of an algo, but its trading some thinly traded stocks.  Executions are way off the back test because bid and ask are moving without the stock trading.

Update Backtest








I had been curious to ask the same quetion. From my understanding though,bid/ask data is not available for backtesting, which seem to be common for possibly all backtest or algotrading platform. But this seem to be reasonable - just image how much more data would need to be saved for not only every tick, but also every bid/ask change. I guess in reality, the tightest bid/ask pair should change much more frequently than stock tick.So if bid/ask is not available for backtest, then it would probably not be valuable in livetrading, because any algorithm that has to do with bid/ask in certain degree cannot be validated first via backtesting. As a result, I guess nowadays there is typically no support for getting realtime bid/ask quotes in most algotrading engine. But anyway I still think being able to get realtime bid/ask quotes is cool.Now that accurate bid/ask quote is not available to your algorithm both during backtest and in live trading, there is something you can do to solve your problem. That includes tuning the slippage model, which is an available feature for this purpose on most backtesting engines and platforms, including QuantConnect and lean, to provide approximation on the actual execution price vs the close price you get in your algorithm, based on your specific security type and its liquidity. That also includes using limit order, with an estimation of bid/ask quotes as within certain percentage of the close price, as the limit price.Just my personal thoughts. Not the official answer. :)

0

To wrap it up, here is at leat what you can do (or what I will do if I were in your case):

1. Customize your slippage model to provide better al

2. Think of the bid/ask quotes to be within a certain price or percentage delta from the latest tick price at that moment.

0

provide better approximation on actual execution price, so that you have more realistic backtest results.

0

Hi, I am new to QC and would like to ask the same question: is there a way to get the bid-ask spread during live trading? From Guanting's replies above, I understand it's not possible in backtesting or even papertrading, but what about live trading (I'm using IB)?

0

I've used data.Ask and data.Bid for spread checks in a forex algorithm, perhaps those?

1

In backtesting whether quote data (Bid/Ask) is available depends on the data you're requesting. We provide as much quote data as possible (futures, options, forex, cfd) but do not provide equity quotes at this time.

In live trading its easier to do but has limited use as its not standardized with backtesting. Once we add backtesting-quote-equity support we'll add it in live.

0

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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Thanks William/Jared, seems like we'll have to wait a bit more.

0

As Guanting Liu mentions you can also effectively model spread with price and volume data. 

0

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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Update Backtest





0

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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed