Hacker News new | past | comments | ask | show | jobs | submit login
How the Stock Market Works (shashankr.me)
140 points by blrboy 76 days ago | hide | past | web | favorite | 69 comments

I was expecting something a lot more detailed. I got to the end and was wondering if this was the first part of a series, since it's nowhere near "everything" anyone would want to know about the stock market. It's barely an introduction.

Then there are the inaccuracies. Zero-sum game? No. Derivatives are "a bet on the rate of change" in value? No. Brokers "help you execute a trade at the best possible price"? Well... not really. The NYSE is a "one stop shop" for people who want to trade? Um, NASDAQ? Any number of non-US exchanges?

Overall, very disappointing.

Bond market is off too - bond writers don't set the rate, they just describe the payment schedule and auction it off. Market determines a price, which implicitly sets the rate.

It seems like an earnest effort by the author. I'd encourage them to find a pro to run this piece by as a further learning experience. When you stop getting edits, you are ready to teach a simplified version to others!

I think the writer has confused themselves while attempting to simplify some of these concepts. Instead they should have accepted the financial market is complicated and cannot be condensed into a single blog post.

For anyone who is really looking to understand how the stock market works, I would recommend picking up a copy of "Trading and Exchanges: Market Microstructure for Practitioners" by Larry Harris.

Yeah, this really isn't a good article.

The very first line:

> This is Part 1 of a series. I am not claiming to be an expert by any means, this is just an effort for me to internalize things I’ve learnt.

"Just like how taking the derivative of a function gives you the slope, a derivative in finance is a bet on the rate of change of the value of a stock, or a bond, or an index."

No. That is just completely wrong. A derivative is a financial instrument that derives value from other things.

As an aside, the derivatives market is far bigger than the stock market.

Derivatives is a difficult to asses market, in terms of size. For example, the largest derivatives markets out there - interest rate swaps - trade contracts that usually have ~zero net value at the beginning of their lives, when the sides open the contract. Derivatives typically start small and sometimes end up huge.

The investable universe looks something like that:


I think the writer was trying to write something cute and smart there with that connection, if only it was actually correct.

This whole article is terrible:

> derivative in finance is a bet on the rate of change of the value of a stock

No. At least no more than an equity is also based on the change in value of the company. At best it is just a terrible way to describe it. It is a derivative because it derives it's value from the underlying. You can get rid of the "rate" part and it would be more correct.

> The New York Stock Exchange is a company that maintains a database that is a one-stop shop for people who want to trade stocks and other fancy financial instruments.

Don't even know where to begin with how misleading that is.

> that is a reflection of a section of the stock market performing “well”, in the sense of investors making money4 on their stock investments.

Not really. It is the value of the companies going up. I'm sure many are losing money too in both a real sense and a "I shouldn't have have sold" opportunity cost regret.

> Depending on what the Fed’s interest rate is, you could conceivably buy a bond off of somebody for lesser than the principal.

Nope. The feds target overnight rate has very little to do with how bonds outside the very short end, and nothing to do with the long end most people would be buying.

> It’s a zero-sum game, because there are always winners and losers in the stock market.

Not really. While each individual trade is zero sum, the collection of them creates more efficient capital flows and helps they health of the market in a very general sense. Without the traders, the market would dry up and nobody would make any money from it.

“It’s a zero-sum game, because there are always winners and losers in the stock market.”

Is this true, outside of options? Most people are long and the stock market has always been on an uptrend.

The economy is not a zero-sum game and that's something I wish more people understood. Real GDP per capita grows. The average US citizen has access to more intrinsic values that aristocrats had just a few centuries ago.

However, he may be talking about pure trading, a.k.a speculation, which is very close to a zero-sum game. If you are not in for the dividends, yes, that's close to a casino where the banks who charge for transactions are the inevitable winners.

I wish we followed Warren Buffet's advice and forbid to sell a stock less than 6 month after buying it. I also don't see any interest in making the stock prices change every nano second. A quote a day can be enough if you are an investor, not a speculator.

> I also don't see any interest in making the stock prices change every nano second. A quote a day can be enough if you are an investor, not a speculator.

Well, there isn't any interest in it per se, but that is intrinsic to how fast we can make trades... Somebody offers the lowest sell price and somebody offers the highest buy price. The "value" constantly changes as those two highs and lows fluctuate based on who decides they'll sell for lower than the lowest offer or who decides they will buy for higher than the highest bid.

Unless you're saying that those offers/bids should only be accepted once/day and can't be changed until the next day? That's the only way I could forsee changing the quote once/day.

Even if you only update the order book once a day, you still need some way to decide which of 2 orders at the same price gets in front of the other, so people still have to compete on time, except now the prices are worse in both directions because market makers have to be able to commit to the price for the entire next day.

My proposal is to randomize the order at which orders arrive. Market makers are largely algorithms by now anyway.

Send orders all day, clear them once a day. Calculate the resulting quote.

Let go of the illusion that the real value of companies change every nano second. The fact that stock exchanges close at night and that for 12 hours, values don't change proves that it is not a necessity.

Having 12 hours instead than a few seconds to think about the impact of a given news on the stock market is going to give room to breath for actual investors.

Trading is necessary for liquidity. The real problem is that uneducated people think trading and investing in the stock market are the same thing.

> Real GDP per capita grows.

Do you know if the share of real GDP for the bottom 10% (or in general, bottom x%) of consumers grown? And is there a well-known term/metric for this?

Increasing inequality is a problem I consider very important for the progress of mankind, but I just want to point out that in this discussion on this specific topic, the share of GDP is not what is important. The absolute number (in PPP) is what we want to look at.

The Gini coefficient will give you a measure for the statistical spread of GDP per capita and is used to measure inequality. [1] Taking the time series of the Gini coefficient and the GDP will show the growth for a percentile of interest.

[1] https://en.wikipedia.org/wiki/Gini_coefficient

I guess I'm searching for a graph that has time on the x-axis and (real gdp * % of income that went to the bottom z%) on the y-axis for 5 ~ 10 different values of z. And hopefully it trends upwards for all values. I'm just surprised this isn't something that economists have already thought of as it feels like it would be the most important GDP-derived metric. Or at least "GDP per capita on median" if that makes sense.

No, it’s idiotic. Companies in in aggregate enjoy earnings growth. Ergo why what you buy today is worth more tomorrow.

There is a zero-sum game in the some sense if you focus on potential buyers. If you buy out all the onions in a grocery store (and continue to do so once they restock), eventually the grocery store is going to start raising onion prices. Thus anyone purchasing onions after you will suffer a slightly higher price. In theory, the long term price of a stock should be the sum of its discounted future cash flows. If you bid up a stock through purchases, anyone who wanted to purchase the stock after you (assuming your decision to purchase did not affect their decision) will suffer a slightly higher purchase price, most likely leading to reduced future gains. Liquidity is gained for any sellers.

This is not really true. The market overall works as a surprisingly efficient resource allocation engine. Onions aren't a great example as they are a commodity rather than a stock.

Regardless, if someone does bid up the price of onions, it will typically trigger increased production of onions as farmers can make more profit by growing onions vs. another vegetable. This increased supply will pull the price back down.

The same happens in the stock market, increased demand (roaring stock market) eventually produces new equity (IPOs). But it doesn't necessarily mean that the new equity is of identical quality (ex: 2000 boom IPOs like Pets.com, or Uber - though we still don't know if Uber is a good stock or not; check back in 5-10 years).

And in the credit market - after all the good debtors are served, and there's still demand for new credit - bad debtors start being served. This keeps on going till it bursts (like in the housing bubble).

Perhaps my argument can be simplified as follows. If everyone had the same models, they would pick the investment with the highest ROI adjusted for risk (ignoring externalities). That same investment is now not available for someone else: they now have to take the second best.

Thanks for the explanation, your argument makes sense.

I'd just look at it in a slightly different, perhaps more optimistic way. The fact that this investment has the highest ROI means that society as a whole would benefit from injecting additional capital into that investment.

In that sense, you're right that other investors have a less desirable price. However in theory at least, everyone is better off since that investment now has more capital, and is able to produce more output, positively contributing to the overall economy and increasing the size of the overall pie.

If the stock market appreciates 7% per year on average, then it appreciates by 0.02% per day and you're effectively making $0.20 per $1000 per day with massive volatility. $0.20 is so miniscule, it's not even large enough for a restaurant tip. It's not that uncommon to see large swings in either direction; The market went -4.85% just this week. The stock market is not a zero sum game over the long term (10+ years), but on a day-to-day basis, the market is effectively a zero sum game. If you manage to make more than the market's return, it's because some poor guy or gall out there made less than the market's return.

Fun fact: over 60% of the trade volume on the stock markets comes from bots. If you have enough of a superiority illusion to think your daytrading game these days can outplay the MIT PH.D Quant traders that wrote HFT bots for hedge funds, then you're in for a surprise.

I don't have the exact Peter Lynch quote but he said something to the effect that any period of less than two years in the stock market and you're basically entering a casino. Any period of greater than 2 years and you're investing.

Some other investor said that you should give a company enough time to use and generate a return from the money it received from selling it's stock before you fundamentally expect to see the returns.

No, it is not true. It is not true for options either. The zero-sum trading game fallacy is a common misperception.

For any kind of asset, the ability to transfer it has value. When someone needs to buy a new car, they often sell their old car to a dealer at a price that is lower than what they could get if they sold it to another individual. They do it because it is more convenient and/or they can't wait around for the right buyer to come along. A dealer has a better idea of the car's value and is willing to put it into inventory until someone buys it at a higher price. He takes a risk he might have to wait longer than expected to sell it again (which incurs more inventory cost), but he trades a lot of cars, so on average, his relative risk is lower than yours would be. He essentially charges you a fair price for this service. Even though technically you might say you lost on the deal, both sides are winners if the price was reasonable.

In a similar way, a stock trade can be a win-win situation. One trader may be willing to do the transaction at a discount because they have a better way to use the money or because they need to reduce their risk. Another trader may know more about the stock and/or have a different risk profile, so he is willing to take the risk of holding the asset until a profitable transaction is possible. This provides a win-win for both sides if the charge for the service is reasonable.

Of course, there are traders who are detrimental to a market and provide no value, just as there are crooked car dealers. That doesn't invalidate the value of good trading just as it doesn't invalidate the value of good car dealing.

Even for options it doesn't have to be zero sum.

E.g. you could give someone insurance on their stock position if you can take the risk. This allows them to participate in the game so you both benefit.

Another is that you might be able to lend more cheaply than the other can loan but they want to leverage up their portfolio. With options you can effectively make a cheaper loan to them to purchase a specific product. They lend more cheaply, you make part of the spread.

It’s not true in absolute terms: for example during a bubble or an upward trend everyone wins. However, if you only consider excess returns (return - some average return), or look at certain derivatives then there are situations where some winning positions require equivalent losing positions.

This is definitely not true. In a zero-sum game, every bit of profit one person makes comes from the pocket of the counterparty. A stock option is a zero-sum proposition: at the expiration of the option, one party ends up “in the money”, the other party is “out of the money” by the same amount.

Stocks are not a zero-sum game. They have sustained value, so when I sell you a share of stock, you get the share, and I get money equal to the value of the stock.

One might argue that day trading is roughly a zero-sum game, if we make the simplifying but inaccurate assumption that the values of stocks don’t change across a trading session, and assuming that everyone goes home each night with all positions closed out.

Yeah, I don't think it is true - as a secondary function, shares can occasionally give dividends.

Funny you say as a 'secondary'. Dividends are the main reason I personally like stocks as long term investment.

According to Rober Shiller's long term data on the American stock market - from 1871 to 2019 the stock market advanced by 2.323% yearly on average without dividends, and 6.836% yearly on average with dividends reinvested. Both figures after inflation. That amounts to total gains of 2'900% and 1'780'000%, respectively.


Dividends make a massive difference. It's in fact not a secondary but a primary driver of long term profit.

shares can occasionally give dividends

Shares don't give dividends. Companies give dividends. Shares are just how they work out who to give the money to.

all the people who labor and can't afford stock lose to inflation in this paradigm

Great article, thank you. I still don't understand who buys and sells stocks. Is there just that much volume that if I decide to sell at a certain market price, there's guaranteed to be a buyer? Or could I decide to sell at market price but nobody actually accepts the transaction? There's some financial magic at work here that I don't quite understand.

The market price is (basically) the highest price that someone else is bidding to buy at, so your offer to sell at that price guarantees there is a buyer because the buyer's bid for stock at that price is already there when you place your offer to sell.

It can get a little more complicated than that though -- you might be trying to sell 1000 shares and the highest bid might only be for a quantity of 500 so the "market" price for your first 500 shares will be different than the next 500 (unless there are other bids at that same price, which there often are but there's no guarantee on the volume you'll be able to sell at that price).

And that's why they call it a stock exchange... it's just a bunch of people (and companies) making bids and offers to "exchange" stocks at difference prices. When a buyer and a sell agree on a price, you have a transaction (trade). Your offer to sell at market price is just an agreement between you and someone else willing to buy at that price.

"Market makers" ensure that at any time, there are standing orders to buy/sell that are close to the current market price (the difference is called the spread). If you buy/sell at market price, you are taking an existing offer at their price.

You could also do what they do. Instead of buying immediately at market price, you could enter a lower price and create a standing order to buy at that price. However, if the price goes up, you might miss out on buying the stock at all.

Similarly for selling. You can enter a higher price, but it won't sell if the market price doesn't go up.

Conceptually this isn't so different from what a grocery store does. They offer something for sale and wait for a buyer willing to pay that price. However, margins are much lower and prices change much quicker for stocks.

(Note: I'm not recommending messing with any of this.)

You are partially right. What you miss is that there are the so called market makers - exchanges that ensure liquidity. They buy from you and sell to you while managing order books. These are simply trades records that have a key role in determining the price pressures for it go up or down.

> exchanges that ensure liquidity

"market participants" which provide liquidity on an exchange.

The exchange itself has a goal to ensure liquidity. Do you really think all your orders are instant because there's somebody on the other side to buy it? I mean, yeah, right - for the very common stocks this is the case, but what about those low liquidity stocks that are still being executed instantly?

The exchange can't trade on their own platform, it would be a massive conflict of interest. The liquidity is typically provided by market makers, who are given incentives to do so. They also get to capture the spread, which is itself fairly valuable. You don't need a conspiracy theory to explain it.

In addition, the market makers gain profit from this activity by buying at a slightly lower price than the selling price.

There is pretty much always someone willing to buy or sell a stock at some price. The best way to think of the exchanges are as a perpetual auction. There is a line of buyers willing to buy shares at all different prices, and similarly there is a line of sellers willing to sell at various prices. Anyone can 'join the line' by entering a limit order at some price.

Buying at market price simply means you immediately buy from the seller offering the lowest price.

It's very rare for an order book to be empty for a particular stock, but you typically do see the bid/ask spread increase as a stock loses popularity.

In the US, the government makes sure the answer to that question is “yes”.

Regulation NMS

Not understanding why this blog is so highly upvoted. It's just poorly written. Someone starting trading on Robinhood is just screaming I'm a financial newbie.

Is the market peaking? With so many clueless entering the market. Where would be the next herd of new blood?

One thing that you have to in your life is to choose your risk exposure to typical assets: cash, bonds (in particular long term bonds), stocks, real estate, and maybe commodities (like gold, or maybe Bitcoin for the courageous). Sharpe ratio is a good way to measure risk/return.

You have 100% at any given point, where does it go? Not buying anything is going 100% cash. That's why you have to do it - you're always in some exposure.

Then you can always lever up securities, effectively going negative on cash. Example: 105% stocks, 195% long term bonds, -200% cash can be achieved by going 35% UPRO, 65% TLT; only for the brave souls among us that do not fear a 300% leverage. This is roughly how the Bridgewater All-Weather Fund operates (AFAIK you can choose your leverage level there).

Many households are quite levered up by getting a mortgage. A mortgage with downpayment of 20% results in 1/0.2 = 500% leveraged exposure to the real estate market (slowly declining over time as the principal is paid, or if the house appreciates in value).

Mortgages have the advantage that you can't get margin called at an inopportune moment.

But the bank that has your mortgage on their balance sheet can get margin called. Ask Lehman Brothers how does that happen :)

I heard through a realtor / friend that during '08 there were some home equity loans that were called back though. I don't know the exact details of those who had their HEL's called but my friend stressed that mortgages would never be called back (unless capitalism collapses) but HEL's could be even if you're making on-time payments depending on terms.

It's also not uncommon to see maintenance (ie tested every x month, not just on initial borrowing) loan to value covenants in commercial Real Estate lending, including at quite small scale (think small independent hotels and the like).

I think there is a desire among people to have a simple guide to what markets are and why they exist, so I applaud the author on the idea and the intent.

However, many of the ideas are misunderstood. A couple months of playing around with a stock trading app and maybe reading some blog posts will not teach you what markets are or why they exist.

For quite some time, a significant amount of brain power has gone into understanding and improving markets. All of this work has resulted in significant complexity.

If I had to pick a place to start, were I to teach someone "Everything they ever wanted to know about the stock market," It would actually be with bonds. Lending money has been around for millennia. It is an amazingly simple, yet incredibly useful, idea. It's also extremely useful as a way of teaching someone about equity. Bonds and equities are intricately linked in their development and in the theory of valuation.

>It’s a zero-sum game, because there are always winners and losers in the stock market.

Not really. Yes, there are winners and losers, but my win doesn’t equate your loss.

And it's also worth remembering that the stock market has increased in value (inflation adjusted) for decades. So whilst yes, it's true there are winners and losers, most of the time the winners outnumber the losers.

Stock is equity in a company. A stock market is where, by and large, publicly listed stock is traded. So why then, all this talk of bonds and governments? Most debt does not trade on a stock market, but via other mechanisms. The author doesn’t have a good definition of “stock” which is worrisome in the extreme.

Serious question. How does an article like this get so many upvotes, followed by lots of comments saying the content is not upvote-worthy?

This falls far short of "Everything You Ever Wanted To Know About The Stock Market But Were Too Afraid To Ask".

Does anyone have a source that actually begins to explain thi stuff? I want something that goes into long/short, that begins to take a stab (in simple terms) at how to analyse a company's finances to identify red flags, or reasons why investing might be a good idea.

To get started, I recommend the McKinsey starter's videos at https://www.youtube.com/channel/UCJetbEO3QGCosQHb_43jVNg/fea...

I think you mean, a personal channel by a former McKinsey consultant.

How can these wildly inaccurate posts about medicine, economics and finance keep getting so many upvotes?

For an even deeper dive, you can check out the stock market primer our team published a couple weeks ago: https://primer.prooftrading.com

This article is garbage, many books have been written on the market. Please search for the real classics and pick one up.

An awkwardly written summary of the Wikipedia page on "stock exchange".

I think the one important lesson that is missing here is: never ever try to be smarter than the market except you have money to lose and you like to gamble.

It's less about being "smarter," it's really about identifying your advantage and understanding whether you can exploit it. This could be something as obvious as an information advantage (insider trading) to simply having more time/patience. If you can buy and hold for decades, you can wait out the bumps, the people who are forced to sell, and for more money to enter the market.

Depends. You can invest low risk (yielding say only 5% yearly profit). If a big company which is supposedly stable falls (such as Morgan Stanley) you may get lose a little but since you spread enough not so much.

You get income than the interest from your bank this way. While in EU you get guaranteed 100.000 EUR when a bank collapses, but if shit really hits the fan (crisis, many companies collapsing, EUR or USD losing a lot of value) you are toasted regardless.

Except I think the only way to make any serious money in the market is to bet against it when things are over/under valued, and of course.. be right.

What does that mean... don't try to buy individual stocks, just buy the index?

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact