I have been collecting data and experimenting with back testing algorithmic trading strategies. Admittedly I am not experienced in this domain and have been trying to build my understanding. I just got setup on Tiingo and have been logging real time top of the book data using their web socket stream via IEX. In visualizing the data I have noticed there are a large number of symbols for which a very large bid/ask spread occurs momentarily before collapsing back to what I would consider to be closer to an expected spread.
As examples I have attached images. See here the symbol PBR for several hours on August 4th the black line and marker are last trade activity, red line and markers are top of book ask, and green is top of book bid. The lines are forward filled so that the last valid ask, bid, or trade price is carried forward during intervals of no updates. The markers indicate where actual updates occurred. Below the first axis I am computing the difference between the forward filled ask and bid then dividing that difference by forward filled bid price to obtain forward filled spread in percent (blue line).
For the 4 hours observed in this history the spread was generally less than 1%. Zooming in on a brief interval in time and you can see more clearly the individual bids,asks, and trades occurring along with the associated spread. In this history there is also a brief spike where a top of the book ask was way way higher than normal and as a result the spread at that moment shot up to 4% actually if you look closely you can see two such high ask prices within about a 15 second window. This to me was surprising, especially given how quickly the high ask price was replaced with a reasonable ask, and then toggled back up again.
I went from being surprised to totally blown away when I started looking at other symbols; even in those traded at high frequency throughout the day I noticed the same behavior. In fact it was not unusual, but instead appears to be the normal. As an example see SLB on the same date and time window, and also zoomed in to see a small slice of time in better detail. I have checked the csv file and the top of book quote appears to toggle from one moment to the next between reasonable and absurd when compared to the actual price a symbol is trading at.
What is going on here? Everything I have read would lead me to believe that generally for high volume equities you can expect the bid/ask spread to be quite slim. Is this an artifact of my data being from IEX? Tiingo? Am I somehow screwing up the logging and as a result I just have bogus data? If these numbers are legitimate how do you determine an appropriate limit order price if you want your order to fill in a timely manner? and what would be the minimum increase required before exit to close the spread after entry? It would seem there are no trades occurring at the price extremes, and I would expect the book to be deep enough that these anomalously high (or low) quotes should not surface, why then do they appear and with such regularity?
In response to reply from Kurtosis stating the issue lies in the data being from IEX:
If the issue is a result of real time data coming from IEX then why does trade history generally track intraday prices as reported by other exchanges?
I find that at the macro level they track fairly well. In this figure find a comparison between IEX Tops data, IEX stream data via Tiingo, Tiingo intraday prices, and yahoo intraday prices for IBM. Intraday interval Close price was used which is why you will see in many instances a minor offset between live trade price and intraday. However, there are multiple instances where the reported close does not match the last trade made on the interval and where discrepancies between reported Yahoo and Tiingo data do exist. Generally these discrepancies are minor in comparison to the presumed discrepancy in spread. See also this for a zoom at a higher temporal resolution where these differences are more apparent.
With this comparison in mind, how can the IEX exchange trade history track other exchanges when there is a large discrepancy in the underlying spread; isn't the spread supposed to drive exchange mechanics?
I thought the bid/ask spread should determine trade prices (I appreciate there are more complicated mechanisms and rules at play but at its most basic level) wouldn't we expect the ridiculous oscillations in the IEX spread to play out in their price history? If trades are effectively decoupled from the spread then why bother providing spread data at all if it is not actually driving trade prices? And if the trade price has decoupled from the spread then is this not a form of manipulation or a failure of their exchange?
Further...
Is it possible this is a symptom of bad HFT and quote stuffing, exacerbated by the relatively low real volume transacted on IEX?
See the report by Credit Suisse "High Frequency Trading – Measurement, Detection and Response" for examples.