Tag Archives: computational investing

Your Broker as a Middle Man

Not all trades execute on the actual stock market.  Let me repeat that – not all trades execute on the actual stock market.  So where do they execute?  At your broker, or your broker’s broker (a market maker).

As I discussed previously, a market has an order book which lists the prices folks are willing to buy and sell at.  Your broker also has an order book, and since it costs them money to execute an order on the actual exchanges, they may try to fill it from their order book, not the market’s.  This is the part that blew my mind – I didn’t know that this was possible – I figured that all trades went through the exchanges. After all, how do you know what market price is if everything’s not traded in a centralized place?  The professor wasn’t completely clear on this, but I think that when a broker fills an order locally, they have to notify the exchange.  Investopedia confirms that the broker has to notify the exchange (principal trading).

So, the brokerage pockets the savings from not executing the trade on the actual exchange, and may have pocketed the difference in the buy-ask spread as well.  Although, since they have to report the trade, the markets stay sort of in-sync – another place computerized trading can take advantage.

I have no illusions that I would ever be able to take advantage of these small inefficiencies and timings, but I find it fascinating to read and learn about them.

Disclaimer: I’m writing these posts as a way to solidify my understanding of class materials, they may not be completely correct – and I welcome any corrections.

How Stocks are Priced

As part of the Computational Investing class, I’m learning all kinds of things about the market in general.  The first is how exactly trades are executed and how a market price is set.

While your online broker can accept multiple types of orders, the “real” stock market can only accept two kinds: a limit order, and a market order.  Limit orders are where you set a price you’re willing to pay for a set number of that stock, or a price that you’re willing to sell at for a set number of stocks.  These orders create an order book at the market.  As limit orders come into the market, they are fulfilled if and only if there’s a matching “price”.  For example, if you are willing to buy 100 shares of a stock at $99 per share, and the lowest anyone is willing to sell it for is $100, your order is not going to get filled at that time.  Your order will go in to the order book until someone is willing to sell at $99/share.  The same happens when you want to sell a set of shares.  This order book exists for each stock listed on the market (and completely computerized of course).  So what happens if no one’s willing to buy at the prices people are willing to sell at?  Nothing – no orders are executed.  This is the “buy-ask spread”.

Market orders are orders to buy a specific number of shares – at the “market price”.  These orders are what “moves stock” in the order book.  If someone wants to buy 100 shares at market price, the order is first filled by the lowest offered price, then the next lowest offered price, etc until the order is filled – and the “price” is the aggregate of all those prices.  The same happens when you sell at market price.

When your broker accepts other kinds of trades, their computers watch the market for specific conditions and places your order on the market as a market order or limit order appropriately.

It is possible to take advantage of this across multiple stock exchanges – called arbitrage.  If stock A is selling for $99 on one exchange (say NASDAQ), and someone on the NYSE is willing to buy for $100 – if you are quick enough (which a “normal” human trader is not), you can buy 100 shares on NASDAQ and sell them at the NYSE for a $100 profit.  The reason that a “normal” trader is not fast enough is that all other hedge funds (with computers physically located in the same data center the NYSE and NASDAQ are) have also seen this opportunity and try to take advantage of it.  This is part of the Efficient Markets Hypothesis – and why a stock has pretty much the same price on all exchanges.

Next Time: Your broker as a “middle man”.

Disclaimer: I’m writing these posts as a way to solidify my understanding of class materials, they may not be completely correct – and I welcome any corrections.