What is the actual math that determines a stock price?

Why I need to know: As a programming portfolio project, I want to make a 'mock market' where fake stocks change price based on market forces. I've googled around but can't find any specific formula or algorithm that does this.

I understand the concept of "people buy, price goes up, people sell, price goes down". This is straightforward and makes sense, but is not detailed enough for what I need to know.

So really, how is the ticker price calculated every few seconds? What is the mathematical process that has to happen? A friend who works in finance said he thinks it's just the mean of all the bids and asks in the exchange, but I was shocked he didn't know for sure.

Any help is greatly appreciated!

submitted by /u/mtv1243
[link] [comments] https://www.reddit.com/r/stocks/comments/14v21nm/what_is_the_actual_math_that_determines_a_stock/
Created 2y | Jul 9, 2023, 7:20:52 PM


Login to add comment

Other posts in this group

Rate My Portfolio - r/Stocks Quarterly Thread September 2023

Please use this thread to discuss your portfolio, learn of other stock tickers, and help out users by giving constructive criticism.

Why quarterly? Public comp

Oct 21, 2023, 1:20:16 AM | reddit stocks
Tax planning when selling one stock to buy another stock?

When you sell a stock to buy another stock, do you prefer to set the estimated amount of the capital gains taxes aside in a money market or do you think it better to

Oct 18, 2023, 6:20:11 AM | reddit stocks
Retirement Planning's-3 stocks could help power your investment portfolio and make you wealthier by retirement.

Saving for retirement is crucial, but relying solely on a 401(k) might not be enough due to high inflation. Consider investing in growth stocks, especially in the tec

Oct 18, 2023, 1:51:00 AM | reddit stocks
r/Stocks Daily Discussion Monday - Oct 16, 2023

These daily discussions run from Monday to Friday including during our themed posts.

Some helpful links:

Oct 18, 2023, 1:50:58 AM | reddit stocks
Discovery Financial Services (DFS). Any good ?

I’m think this is not a good investment as there is no chatter at all on the 52 week low. They are involved in a class action lawsuits by investors and credit card co

Oct 18, 2023, 1:50:56 AM | reddit stocks
Tax implications of selling one etf for a dividend etf?

Sorry if this is the wrong sub. Let’s say I had $1 million in VOO but I wanted to sell half of it to buy SCHD. It would suck to pay taxes on $500k. So how would you g

Oct 18, 2023, 1:50:53 AM | reddit stocks
Crocs Stock Analysis (CROX)

Hey guys, I did a deep dive into Crocs. In this analysis, I will do a brief breakdown of the company and go over some quantitative data, qualitative data and estimate

Oct 18, 2023, 1:50:51 AM | reddit stocks