Every 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?
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.