Q on the mechanics of a stock market.

I’m looking for a relatively in-depth look at how a typical stock market functions–preferably a website I can look through. I’m an engineer, and looking to get into the “weeds and seeds” of how this whole thing works. It’s gotta be more complex than just inputting your buy or sales price into your online broker, and WHAM there’s 100 shares of XYZ in your account.

To start, what piqued my interest is the fact that prices fluctuate. While we all get that “demand and supply drives the price”, I’m curious as to what functions actually influence the price. I’ve seen my stock go from $1.60 to $1.72 in one minute, only to drop to $1.575 five later. . . What is actually reported, the last trade’s pricing?

Second, what actually takes place when a trade occurs? It can’t be just “Bill from AAA Online” shares electrons with “Jim from ZZZ Brokerage”. Is it like paper checks, that trades are all just agreed to, and then just forwarded to a clearing house for processing? Or do they employ legions of hamsters in wheels, running through tubes with little scrips of paper to make the trades?

Third, where’s the actual work of off-board trading take place? In cyberspace? My stock isn’t listed on the NYSE, AMEX, or to my knowledge, the NASDAQ (it’s Owens Corning – OWENQ, for what it’s worth). Is there just a server running somewhere that does the work in my second question?

Yep, they’re mechanical quesitons, but I’m genuinely curious. I know it ain’t gonna help me in my money, I’m just wondering how it all works. . . I guarantee I’ll have more questions later.

Tripler
I can’t guarantee your replies are tax-deductible. Sorry. . .

It’s a bid-ask system. the traders state their bid (how much they will be willing to pay) and ask(sell) prices, and if they match, then a trade is executed. The default rest position is that all trades are executed and there is only a bid and an ask price that are different. The difference is the bid-ask spread. You want to buy a stock, you jump in the market and fulfill the ask price, and will buy all the stocks available at that price, after which the next higher ask price will be the “price”.

There are a number of theories and stochastic processes used to model the fluctuation of the stock markets. I can’t claim to be an expert in all or even one of them. Maybe someone more mathematically inclined can provide a more detailed explanation, but in the mean time, read up on the “random walk hypothesis”, Geometric Brownian Motion, and Chaos theory.

It’s electronic. No hamsters or scrips of paper are involved.

They do.

So I assume that if there’s 1000 shares @ $1.50 left hanging open with no takers, and I jump in there looking to buy 500 at a market price, I’ll have 500 @$1.50, and the seller is left with the other 500?

I will look into some of those theories though . . . It sounds like the markets are just one giant bulletin board (like the SDMB) then. . .

Tripler
Interesting.

There is one additional factor: market makers. Brokerage firms “make a market” in particular stocks, which means they’re required to buy shares from the seller and hold onto them until a buyer is found.

Thus, in your example, the extra 500 shares would be bought by the brokerage firms that make a market in that stock (on NASDAQ, there are many firms making a market in any stock, so the risk is shared). Then, when someone comes along to buy the stock, and no sellers are available, the market maker sells the stock to them.

Market makers ensure there is always a buyer or seller for any given stock.

The NYSE is slightly different: they have individuals called “specialists” who do the same. It used to be that specialists would handle a group of stocks and all stock trades went through then; it may have been replaced by electronic systems by now.

Basically yes, and as Realitychuck points out, you might be dealing with 500 shares while the seller is an investment bank dealing with 1,000,000 shares. Also, your 500 shares can be prices at whatever ask price you want, but of course if the other guy’s ask price is still $1.50 then you probably won’t be executing any trades at $3.00.

Investopedia explanation of order execution