While I get the general idea of liquidity I really can't get my head around how it is supposed to work out in practice, especially in HFT. So let me make the question a bit more concrete.
A very illiquid market, I want to buy for $9, somebody else wants to sell for $10, nothing else. And now? How does HFT help? How does a traditional market maker help? He buys for $10 and sells for $9 and then somehow recovers the loss?
Market makers are not charities, they're there to provide a baseline for markets that don't have that many orders available (liquidity). This liquidity allows people to enter and exit positions more readily, encouraging real entrants to start trading the once quiet market.
People are more likely to trade if they feel a lower risk of being stuck in a 'bad' position.
Many times, exchanges actually pay market makers to provide liquidity to try and kickstart a particular market.
Liquidity refers to the fact that when you want to sell a stock, you can sell it immediately.
The more liquid something is, the closer it is to cash.
Think about your car -- if there was a public price for your car and you could decide at any moment whether you wanted to sell for that price, or close to that price, that would be a benefit to you. But instead selling your car is quite a chore and you are never sure whether you are getting ripped off or not. A liquid market has a public price and a degree of fairness and confidence baked into that price.
In order to provide liquidity market makers agree to buy stocks from anyone who will sell them, and then take care of finding the buyer on the other end. The difference between what they buy it for and what they sell it for is called the 'spread' and it is how market makers traditionally have made money. The spread is also the fair fee they charge for the service they provide, which is liquidity, and the risk they take. If market makers did not know for sure that someone else would be willing to buy the stock right away, that they might have to sit on it, they would be taking on a very large risk. The more people that buy and sell, the less real that risk becomes.
HFT makes their money, generally, by front running. Front running is the practice of buying a stock because you know the California Pension Fund is about to buy it, and so you know the price is about to rise. You can immediately turn around and sell it when it goes up.
Front running by a bank is illegal, but it is widely suspected that many banks engaged in the practice for years. It is illegal because the bank is supposed to be acting on their client's behalf and in their interest, so when they are trusted to place the order, they first buy some of the stock for themselves or for the bank's inside funds. It is basically insider trading.
When HFT engages in front running, they have detected that an order is coming down the pike, and they jump in front at the last nanosecond. The reason they spend so much money trying to do this is because it is essentially fool proof when done correctly. You can argue that by not taking any market risk, and not holding the stocks, they aren't providing liquidity, they are parasites on real stock traders and they are essentially using inside information. But its not that cut and dried because there is almost no way to eliminate the problem. At least HFT reduce the time window during which someone's signal to purchase something can be exploited.
It used to be that humans managed all of this. Large brokerage houses would be responsible for executing these trades, and it was common practice for brokers to tip each other off when they received large orders. These tips were very valuable because they guaranteed a winning trade. If you ever wondered how meat-head frat boys could make millions of dollars on Wall Street despite not being especially intelligent, this was a big part of it. At least now the people who are scalping everyone's orders have to be brilliant.
Right. Instead they have small orders placed. As soon as that order is fulfilled on that exchange, depending on algorithms, the HFT will look for opposite orders on other exchanges, and buy, very quickly. If it can do so before the matching engine gets there, then the price can be driven up.
For example, you want to buy 10,000 shares of X.
Matching engine finds 100 at 9.98 - it’s the NBBO (best buy offer), it’s required to execute that, and carry on looking for ways to fulfill your order below or at your bid.
Meanwhile, the HFT offering those 100 shares sees this, decides its a parcel of a large buy, and if it has a quicker route / algo than the matching engine to other exchanges, goes there, executes immediate buys at say, 9.99, then immediately raises their price to make a profit on the spread.
Except that's not how the latency arbitrage trade actually works.
What is actually happening is that the HFT is offering shares on all the exchanges on both sides of the bid/ask spread at the same time. When they get filled on an order at a price on 1 exchange it is used as one of many signals to indicate if their pricing is accurate. If their algorithm thinks that fill indicates a price movement (for instance if the entire level was removed) then they will update their prices on all the other exchanges accordingly. If the algorithm doesn't believe this indicates a long term price movement they won't (or they may even re-up at the same price on the exchange they got filled on).
No one is going out and buying ahead of someone else because that is too expensive (you have to pay the bid/ask spread to do it) and too risky (you might be wrong about your price determination).
Finally, just a detail, you can typically opt out of NBBO matching if you want.
Liquidity directly relates to the number of participants (or quotes) in a market place. Let's think about a simple market, where the price of a good can go from 1 to 10 dollars. One person is looking to sell the good for $8, while another person is looking to buy at $2. The market currently has a bid-offer spread of $6. With only two participants in this market place, they will have to meet somewhere in the middle, or never trade. The seller will lose value because he has to sell at a lower price, while the buyer will lose money by paying more. However, if there were more participants in the market place, all with different ideas about how valuable the good is, the buyer is more likely to get their $2 price while the seller is more likely to get their $8 price. For example, if a new seller joins the market at a price of $6, the person looking to buy can now do so at a cheaper price.
Basically, with more participants, the bid-offer spread will begin to close, and trading will occur at more prices.
A very illiquid market, I want to buy for $9, somebody else wants to sell for $10, nothing else. And now? How does HFT help? How does a traditional market maker help? He buys for $10 and sells for $9 and then somehow recovers the loss?
(Further down tptacek posted a great analogy. https://news.ycombinator.com/item?id=7853500)