Wednesday, October 10, 2012

High Frequency Trading, Providing Liquidity, or HFT

A student was asking me about high frequency trading as he is getting offers to work for such companies in Montreal. I wanted to give him a short briefing on the financial aspect of it and the IT aspect (as I am mixing both worlds).

I found a very interesting story on /. (slashdot.org) that simplifies the concept in very concise manner.

It is and this is the basis of high frequency trading... though on Wallstreet they call it "providing liquidity". It works like this:
Alice wants to sell 1000 shares of Acme Corp. She places an sell order for 1000 shares at $25.00 on the exchange, but she also places a minimum bid of $23.90 on the sell order. This minimum bid what Alice is willing to accept should someone counter-offer but is suppose to be secret, only the sell price will be published.
Bob is looking for 1000 shares of Acme Corp. He wants to place it in his portfolio for long-term growth, but he thinks it is currently worth less. Bob places a general buy order at $24.40 on the exchange. For the sake of simplicity we will say that is his only price, though he too could have a maximum bid he is will to pay.
So there is a sell order at $25.00 and a buy order at $24.40 pending on the exchange, nothing trades. Now Bob could make a buy offer to Alice at $24.40 and the trade would go thru, or Alice could make a sell offer to Bob at a lower price and follow thru. In a perfect world the exchange would figure it out and match the orders... but that doesn't happen without further action on the part of Alice or Bob.
Eve is a high frequency trader... Actually, Eve is a high frequency trading program at MegaTraders LLC. and has spotted that there are buy and sell orders for Acme Corp on the exchange. Eve places a bid at $24.99 for Alice's share, the exchange accepts, and then Eve immediately cancels the bid order. Eve has just learned that Alice is will to sell for less than the sell order posted. Eve then continues placing bids on Alice's stock, $24.98, $24.97, $24.96, etc., each time immediately canceling the buy when the exchange accepts the bid. Eve gets down to $23.89, at which point the exchange does not accept the bid for Alice's stock. Eve has just learned that Alice is willing to sell for as little as $23.90 and all of this has happened within 10s of milliseconds.
Remember all those articles on Slashdot about high frequency firm X laying their own fiber directly to the exchange to cut milliseconds off transit time? Having custom L2 firmware on their switches and no firewalls on their trading links to cut milliseconds off transit time? This is why they do it, so they can submit hundreds/thousands of buy/sell/cancel orders on a single stock within a fraction of a second to learn pricing differences between orders that otherwise should be secret.
So Eve now knows that Alice is will to sell for $23.90 and would perform the same procedure against Bob to discover his highest buy price. Once found Eve can now see a price difference advantages to herself. Eve buys the 1000 shares from Alice at $23.90 and then immediately sells the shares to Bob at $24.40, pocketing the $500 difference. On Wallstreet they call this "providing liquidity", anywhere else this would be considered insider trading and illegal. Multiple all this by several hundred firms with special inside access to the market place, each running their own competing Eve programs, and you quickly realize how the market can go into turmoil within seconds....

You will find more interesting stories about HFT online.It seems robots are already playing with our money. Nora Young (http://www.cbc.ca/spark/) was speaking last week about robots helping humans. It seems, there is a need now to explore the options of looking at how robots can beat humans. Yes computers are dummy machines that execute what they are told to do. However, computers can accumulate knowledge and use it much faster than humans. This is the horror part of it.