Ask HN: What scientific phenomenon do you wish someone would explain better?
607 pointsI've been studying viruses lately, and have found that the line between virus/exosome/self is much more blurry than I realized. But, given the niche interest in the subject, most articles are not written with an overview in mind.
What sorts of topics make you feel this way?
Comments (813) 149 threads
Earlier commentsEvery article on "Where do stock prices come from?" seems to just talk at a high level about supply and demand.
But where does the price come from at a nitty-gritty level? Is it an average of all existing offers or something?
Do different exchanges and stock-ticker websites have different formula for calculating share price?
If a very low-volume stock is listed at $4, and then I offer to buy a share for $100, does the NYSE suddenly start listing its price at $100?
There are people who put limit orders on the exchanges. Say that the price of TSLA is $500. I think it's overpriced, and its likely to go down, but then grow in the future. I can say, "I'm willing to buy 100 shares of TSLA at $420." Someone else holds TSLA and thinks its likely to go up, but not hold it's value, so they say, "I'm willing to sell 100 shares of TSLA at $690." The sum of all of these limit orders forms the market depth chart.
The more common way to interact with the market is to say, "I want to buy a share of TSLA at the current market price." In the above example, the only option is to buy TSLA for $690, even though the last transaction was $500! This is a example with very little market depth. In the normal case, you'd buy your share for $500.02 or something like that. (Same, but reversed, for selling at market price.)
For more information, but with a crypto focus, see https://hackernoon.com/depth-chart-and-its-significance-in-t...
For your example, you would put in a market order, and buy the stock at the lowest price that someone was willing to sell it at. If the last price was $4, but the lowest limit order that currently existed was for $100, and you bought it for $100, then yes, the price would go up to $100. (In real life, those sharp upticks don't happen much. It's more likely that a sharp downtick happens, where suddenly everyone wants to sell oil futures at the same time, but almost no one is willing to buy them, so the price ends up negative.)
Note that whenever people defend high-frequency trading for "providing liquidity to the market," this action of setting buy and sell limit orders that are close to each other is what they are talking about. There are algorithms that will see TSLA at $500, and offer to sell TSLA at $500.02 and buy TSLA at 499.98. If both orders go through, they make $0.04. If you operate fast enough to get out ahead of any big market moves, you can make a lot of money. But if you ever accidentally buy a bunch of TSLA for $499.98 right before the price plummets to $420, then you just lost a lot of money. This is why HFT and other trades with similar risk profiles are sometimes referred to as "picking up nickels in front of a steamroller."
Now that can either mean that someone bought a share that someone else was selling or that someone was selling a share to someone who was offering to buy.
The shares are listed as a series of buy and sell orders in what's called an order book.
If the price a share was sold at was 100$ and you think it will go a bit lower, you could place a buy order at 90$. Should enough people sell shares to reach your price and order, your order will be filled and you will own the share at 90$.
If someone wants a million shares at 91$, you may not get your single share at 90$.
To go back to your example, if you were to place a buy order at 100$ for a 4$ priced share, how much the price moves depends on how many sell orders are in place from 4$ to 100$ and how much you are buying.
If it's only one for share, your order will probably get filled at something like 4.01$ if the spread is low (the spread being the difference between the highest buy order and the lowest sell order).
If you're buying 1000 shares and it's a low volume stock with a "thin" order book, maybe it could go up a few dollars instead but for it to go up to 100$ you have to buy every single share between 4$ and 100$.
My understanding is that I buy a contract for 100 shares at a future date of my choice.
So let's say stock XYZ is currently trading at $20, and I buy a futures contract for $100 for Jan 1st 2021.
I don't have enough money sitting around to buy those 100 shares, so let's say XYZ is trading at $200 by Jan 1st 2021, That means I have a contract where I can buy 100 of them at $100 and immediately sell them for $200, so in theory it's a $10k profit.... but because I don't have enough money to actually do that, do I just sell my future for something close to 100* $200 (because someone with enough money will buy it and do the actual trade?)
What happens if it's already well over $100 long before Jan 1? Can I just set a price and sell it whenever I want like a can with a regular share?
So if I have a futures contract for 1000 barrels of oil for $10 a piece, when that expires, no matter what the price of oil, $10000 will be taken out of my account and someone will contact me to come pick up those barrels (there's some nuance here, but let's ignore that)(funny story about this at the bottom). If I have an 10 options contracts for 1000 shares of stock XYZ at $10 a share and XYZ is at $9 a share, I can just let the contract expire worthless.
From here on out, I'm going to talk about options, because it's closer to what you are asking.
> I don't have enough money sitting around to buy those 100 shares, so let's say XYZ is trading at $200 by Jan 1st 2021, That means I have a contract where I can buy 100 of them at $100 and immediately sell them for $200, so in theory it's a $10k profit.... but because I don't have enough money to actually do that, do I just sell my future for something close to 100* $200 (because someone with enough money will buy it and do the actual trade?)
Contracts are exercised after hours. If you don't have the money you will usually collect the shares and be put in a margin call (you owe your broker money) and then the shares will be sold first thing the next day to cover the margin call. Some brokers will try and sell your contract for you before the end of the day the contracts expire if you don't have the money. So you may only get $9950 or something for your contract and it will be sold to someone else a few hours before the market closes.
> What happens if it's already well over $100 long before Jan 1? Can I just set a price and sell it whenever I want like a can with a regular share?
Yes, the contract itself cost money and can be bought or sold.
This isn't a perfect analogy, but think of the contract like a coupon. If I have a coupon for to buy a TV for $100 and the cheapest anywhere is selling that TV is for $200. That coupon has an intrinsic value of $100.
The analogy breaks down, because in the real world, you probably couldn't get $100 for that coupon. You'd probably get slightly less than the price difference. With options on the other hand, you usually pay slightly more than the price difference, because of the volatility of the underlying. Basically, someone might pay you $105 for that coupon because they think they the TV price will go up and they can sell it to someone next week for $110.
========
* As a side note, when people were saying oil prices went negative last week, it's because the May futures contracts were about to expire. Basically, it was the second to last day people could trade the contracts before they had to take delivery of the oil and, since so few people are using oil right now, many of the places where people would normally store oil are full. Since you can't just dump oil down the drain, people holding oil contracts were willing to pay other people to take over the contracts so they didn't have to take delivery of the oil.
Continue this thread — 2 replies
If you actually meant your original wording, theoretically whichever order came second would fill at the best price.
Assume there are no other orders in the order book.
Scenario 1: Seller submits a limit sell order for $90. Since there are no buyers, this order goes into the book. Then a buyer submits a limit buy order for $100. The order would be filled at $90 (the best ask) and the buyer only pays $90. Here, the seller is the maker and the buyer is the taker.
Scenario 2: Buyer submits a limit buy order for $100. Since there are no sellers, this order goes into the book. Then a seller submits a limit sell order for $90. The order will be filled at $100 (the best bid) and the seller gets $100. Here, the buyer is the maker and the seller is the taker.
Market makers are responsible for setting prices and providing liquidity. If you want to understand this in more detail, check out this post [1] I wrote up a while ago.
[1] https://www.tradientblog.com/2020/03/understanding-the-limit...
In simple terms, when you want to buy 100 shares of a stock at no more than $4, you place a limit order into the exchange’s order book for that stock. Other buyers do the same, as do sellers. The order book is a sorted structure with the orders and their sizes on each side. It may look like this:
Sell 100 @ $7
Sell 300 @ $6
Sell 300 @ $5
Buy 100 @ $4 (your order)
Buy 200 @ $3
Buy 100 @ $2
Notice the gap between the highest buy (“bid”) and the lowest sell (“offer“ or “ask”). This is called the ”bid/ask spread.” Whether we’re talking stocks or eBay or a local outdoor market, buyers always want to pay less, sellers always want to earn more, and there is always a bid/ask spread.
If instead of sticking to your $4 limit, you said “forget it, I just want the stock” you would enter a market order instead of a limit order. In doing so you’d “cross the spread” and pay $5 per share. For a trade to happen, someone has to cross the spread.
If you entered a buy order with a limit of $100 in this example, you’d still buy at $5. If you ordered 400 shares at $100, you’d buy 300 at $5 and 100 at $6. The $5 offer would come out of the order book and the $6 offer would be reduced in size.
When you think of the market as all of this upward and downward price pressure focusing around a spread, you can see that the price the market values the stock at is conceptually the midpoint between the highest bid and the lowest offer, also known as the “mid.”
As prices change, the spread’s price level moves up and down, it narrows and widens, but the price you see always at least indirectly reflects that midpoint of price interest between all buyers and all sellers. There will always be intricacies in price reporting (based on the price feed, the price you see is the last trade made, the mid, or something more complex), but if you understand the order book, you’ll have the basic idea and can build from there.
If you’re really interested, you can google how and when the various exchanges calculate and report their prices, who they make them available to directly, what vendors provide raw and aggregate views of those prices, and more. There are many flavors varying from real-time tick-by-tick reporting to end of day feeds and more.
All of them ultimately begin with what you can now visualize as an order book.
Each exchange is basically its own world, with the exception of Reg NMS, which I'll get to in a sec.
Let's task about order books. Each stock has its own order book. This might be an example of the book for AAPL:
* SELLING 100 shares @ $10.02 * SELLING 200 shares @ $10.01 * SELLING 100 shares @ $10.00 * BUYING 100 shares @ $9.99 * BUYING 200 shares @ $9.98 * BUYING 100 shares @ $9.97
So if you want to buy some AAPL, you will want to go grab the cheapest shares you can see, which here is the fellow selling 100 shares at $10.00. You submit a limit order to buy at 10.00 and are matched with that guy. The book now looks like this:
* SELLING 100 shares @ $10.02 * SELLING 200 shares @ $10.01 * BUYING 100 shares @ $9.99 * BUYING 200 shares @ $9.98 * BUYING 100 shares @ $9.97
Now let's suppose a market maker decides they think the price is going to follow, so they go and fill in the hole by submitting an order to BUY 100 shares at 10.00. There's no more shares to buy at $10.00, so their order rests on the book.
Now we have:
* SELLING 100 shares @ $10.02 * SELLING 200 shares @ $10.01 * SELLING 100 shares @ $10.00 * BUYING 100 shares @ $10.00 * BUYING 100 shares @ $9.99 * BUYING 200 shares @ $9.98 * BUYING 100 shares @ $9.97
Now that we've played out this scenario, let's go back to your original question. What is the price of AAPL at any point in here? Well, it depends. At the start, if you wanted to buy, you could say the price is $10.00. But if you wanted to sell, the best you'd get is 9.99. So, hard to say.
It's worth noting that the prices you see in the book are only there because people aren't agreeing on the prices. If they did agree, a trade would happen, and the prices wouldn't be on the book. So, with that in mind, you could say that really, the price of a stock is the last price people agreed at: the last trade price. That's better, we're at least down to just one price to think about.
That could be quite different from what the best bid/offer are right now, though (some stocks don't trade very often) so even if (let's say) you last saw AAPL trade at 9.50 before our example, obviously that price is long gone. So even the last trade price is potentially not "the price of the stock".
So, in short, there's really no such thing as "the price of a stock". It'll all depend on how sophisticated you want to be about the price at which you buy your shares.
When people talk generally about the price of a stock, it's usually just up to whatever site people are looking at, and usually markets are liquid enough and trade enough that all the kinds of prices we just talked about are usually only a penny different, so when people are just at the watercooler saying "Did you see the price of AAPL?" they don't care about the pennies, and by the time they've managed to say that question, the price has moved anyway, probably lots of times. So it all gets a little hand-wave-y.
I want to mention two other things that might interest you. Reg NMS is what ties all the exchanges together, so to speak. Let's say you want to buy AAPL and NYSE has shares selling at $10.00 each, but NASDAQ has them for $9.99 each. It's actually illegal (against Reg NMS) to trade with that guy at $10.00 at NYSE because NASDAQ has the "NBBO" (national best bid/offer) right now. Extra caveat: if you sent a special order to NYSE that says "I promise you, I've also sent an order to NASDAQ to buy the shares for $9.99 and I've determined you're the next best price at $10.00, let me buy them", it'll let you. It's called an ISO (Intermarket Sweep Order) and if you lie about them or mistakenly lie about them, you get fined. A lot.
The other interesting thing: Your last question was "If a very low-volume stock is listed at $4, and then I offer to buy a share for $100, does the NYSE suddenly start listing its price at $100?" There's actually a lot to unpack here. Let's go through it.
If you're a registered broker-dealer and are connected directly to NYSE, and you send a limit order for XYZ @ $100/share, what's going to happen is you're going to get "price improvement" and you'll end up getting the shares at $4. If you send an order for LOTS of shares at $100, you'll clear out a bunch of price levels in one go. Ex:
Let's say this is the book for XYZ:
* [...] * SELLING 200 shares @ $110.00 * SELLING 1000 shares @ $5.00 * SELLING 200 shares @ $4.02 * SELLING 100 shares @ $4.01 * SELLING 500 shares @ $4.00 * BUYING 100 shares @ $3.99 * [...]
Usually when you get away from the middle of the book, liquidity dries up fast and the prices get further apart. So let's say you send an order for 10000 shares at $100. You're going to get 500 at $4, 100 at $4.01, 200 at $4.02, 1000 at $5.00. Now the next price is 110, but your limit price is 100. So your order will now actually rest partially-filled on the book. So now this is the book:
* [...] * SELLING 200 shares @ $110.00 * BUYING 8200 shares @ $100.00 * BUYING 100 shares @ $3.99 * [...]
Neat, huh? That was a lot of price movement. So yes, if you can send for enough shares and are willing to pay through a lot of price levels, you can move the price of the stock. Remember Reg NMS though - if more stock exchanges existed in our example, you'd also likely need to go get shares at them if they have a better price than the exchange you just moved the price at.
But let's now suppose you're NOT a registered broker-dealer, but are instead Joe A. Schmoe, a client of Charles Schwab Brokerage. You enter your order in your web browser and hit trade. Schwab has a legal obligation to fill your order, if possible, only at the NBBO. They could route your order right to an exchange, but instead, they will send your order to their friend, Citadel, who will have the opportunity to trade against your flow before it gets routed to the stock exchanges. Generally, this is good for you: they might decide your order represents good information and they want your shares. They could decide to fill your order themselves and sell you all 10000 shares you want. They're constrained by the NBBO though, so you get all 10000 shares at $4. For being the source of this order, Citadel pays Schwab some money. Usually practically a pittance, pennies, if that. Order flow is dirt cheap nowadays.
This is called "selling order flow" and lots of people find it scary, because it's not really super intuitive why someone would want to buy or sell the actual flow of orders. But it's actually pretty boring and more about high-level statistics than anything actually interesting to Joe Schmoe, who would get bored when he realized he's not really getting ripped off.
Sorry, I got a bit off-topic. But I love finance, so please forgive me.
Now I try to always put limit orders. I put sell for Boeing at $150 with “good till cancelled” option. One morning I wake up to see they’ve been fulfilled. Wohoo! But the price had dropped down to $140. So I cashed in on the spike.
The market is crazy. I still don’t understand if. P/E ratios for some companies are through the roof (100+), why are people still investing in them like crazy? We don’t have a cov2 vaccine, millions of people don’t have jobs, why did the marker recover half it’s losses already? Shopify, Amzn, Zoom. WTF! Their charts seem hyped. Or may be I’m just plain wrong and don’t understand the fundamentals.
Since the outbreak of COVID-19, demand for the kind of services offered by those 3 Internet businesses have in fact skyrocketed. Increasing demand imply those businesses still have room to grow revenue. Shopify [1] for instance is now seeing huge Black Friday-like traffic during the shelter-in-place and a lot of these small businesses are first-timers on their platform who will likely stick around after the pandemic.
1: https://mobile.twitter.com/jmwind/status/1250816681024331777
You really didn't have to apologize! I thoroughly enjoyed your explanation. I can't recall how many times I've searched Google for "How are stock prices determined?" and come back with nothing. Your answer was better than 100% of everything else out there.
I'd love to learn more about this. Are there any books, blogs, etc. that you could recommend? Also, YOU should really consider blogging about this!
At the very lowest level, it could be gut feelings from a potential buyer. They see electric cars more frequently, combustion engines going out of fashion, and simply wonder "Hey, why does that [electric car company] trade so low, when they'll probably be market leaders in 5/10/15 years?", or conversely, "Hey, why does that [petroleum] company trade so high, oil prices are shot, and the industry will lose relevance in 10/20/30 years"
On a higher level, some potential buyer will look at the companies financial statements, and figure out if the share price is too high / low for how the company is performing, from a financial standpoint. This is called "fundamental analysis", and you can easily find step-by-step analysis reports of such on various companies.
But the market is one big hodgepodge of beliefs, with probably thousands of different rationales behind their prices, and motives for sales / purchases.
How does this work if a company doesn't pay out dividends? There's no investment to return unless someone buys from you at the same or higher price... right?
Long answer: You need to understand how the Limit Order Book works. I wrote up something about this here [1]. It also goes into different definitions of price.
> If a very low-volume stock is listed at $4, and then I offer to buy a share for $100, does the NYSE suddenly start listing its price at $100?
If you trade actually absorbs the order book and pushes the asks to $100 then yes, that could be case depending on the exchange, but I'm not sure about NYSE specifically. Most likely that could never happen due to various hidden order types and HFT market makers though.
[1] https://www.tradientblog.com/2020/03/understanding-the-limit...
Let's say someone owns shares in a very low-volume stock — one that gets a couple trades a day, at most. Could they artificially increase the share price by offering their shares at a high price, then using a second account under their control to immediately buy them at the inflated price?
[0] https://www.risk.net/definition/cross-trade
https://www.amazon.com/Trading-Exchanges-Market-Microstructu...
(Also it's strange that sometimes there is disagreement about the mechanics between actual practitioners, see the recent confusion about whether fractional reserve banking is true.)
The situation is somewhat similar to a classical spinning charged sphare, although this similarity easily breaks down.
Do you know an example of a process that moves angular momentum from one kind of spin to the other?
It's more akin to the direction or axis of the spin being changed, and simply measuring the spin along a certain access will change it: https://en.wikipedia.org/wiki/Spin_(physics)#Measurement_of_...
Spin being an intrinsically quantum mechanical concept, I'm afraid the microscopic mechanism by which that transfer occurs will only be explainable in a quantum mechanical context. Here it will appear as a term in the Hamiltonian coupling the spin of an electron to its motion in a potential.
https://en.m.wikipedia.org/wiki/Einstein%E2%80%93de_Haas_eff...
Correct.
> But why do we call it spin?
Because it is a physical quantity whose units are those of angular momentum, and we have to call it something.
> What are the possible values?
+/- h/4pi where h is Planck's constant. (It is usually written has h-bar/2 where h-bar is h/2pi.)
> Is it a magnitude or a vector?
It's a vector that always points in a direction corresponding to the orientation of the apparatus you use to measure it.
> Is there a reason we call it "spin" instead of "taste" or some other arbitrary name?
Yes. See above.
> How do you change it?
You can change an electron spin by measuring it along a different axis than the last time you measured it. The result you get will be one of two possible values. You can't control which one you get.
> What happens to it when particles interact?
Their spins become entangled.
It's not exactly a vector...
So it can be written as a vector? No?
That's right. It's not a vector because it doesn't "transform" like a vector.
If you take a vector and rotate about an axis by 360 degrees, you get the same vector.
If you take a spinor and rotate it by 360 degrees you get a spinor which is "flipped". You have to rotate the spinor by 720 degrees to get back to the same spinor.
This is intrinsically weird, but that's QM.
It is techinically a two-component spinor, which is why the direction of the spin 'moves' if you measure it along different x,y,z axes. It is also quantized unlike a normal vector: All fermions have quantized half-integer spin magnitudes and all bosons have integer magnitudes.
Magnetic fields can be used to change the spin.
When particles interact, opposing spins tend to pair up in each electron orbital which cancels the magnetic field. This is why permanent magnets must have unpaired electron orbitals.
Continue this thread — 1 reply
Continue this thread — 2 more replies
Continue this thread — 4 replies
1) news articles/lay press - basically terrible and typically get things wrong
2) scientific lay press (scientific american, discover, science news) - get things right, but generally no data/citations or nuance
3) journal summaries - get things right, citations and data for everything. Good summary of the latest scientific thought on a topic. Tend to push a point of view, which generally will be right, but that educated people can debate. Dont always show the data, but at least refer to it. These help you to get up to speed with the primary experiments that were used to establish current thinking.
4) first source articles - typically make claims too broad for the actual results. But has all data. Often times the claims don't follow from the data at all. Generally have to work in the field to understand strengths and weaknesses of methods and you cant just take the conclusions at face value.
As a PhD student, I used #3 a lot to get centered on a space. To understand 4, I typically had to learn directly from my research advisor or other grad students that specialized in an area.
My point here is that you can find these summary articles in journals (microbiology, immunology,virology etc). They are published infrequently so can be hard to find, but they exist and you should look for them.
Continue this thread — 4 replies
All comments shown.
Couldn't load more comments. Check your connection and try again.