문제

I am looking for an algorithm that will calculate the intrinsic value of a stock based on the number of people buying /selling it and additionally consider the calls/puts to fluctuate the value of the stock.

Essentially:

Current Price = Function(Stock Price, Number of Sellers, Number of Buyers)

Essentially I want to know how the stock exchange server backends work and the algorithms involved in calculating the stock prices.

Any guides/help or documentation in this regard would be extremely helpful. I tried looking around using google but the information is very sparse, inaccurate and I don't even know what keywords to use for efficient search.

Also, are there any existing Java code that I can look at to get an idea?

Also, I found API close to what I was looking for at http://jessx.ec-lille.fr/index.php. Would still in interested to learn about the technology/algorithm behind it.

도움이 되었습니까?

해결책

I think you are mixing two things here. In simple terms, an exchange provides a service that enables buyers and sellers to meet each other and realise transactions.

The price at which transactions happen is entirely determined by the orders received by the exchange (the clients buying and selling), not by the exchange, which merely reports the prices at which the transactions occur.

Where the exchange might have an impact is where it enables certain types of orders (say a stop order for example) and how it handles it - but it does not sound like you are interested in that part.

What you seem to be looking for could be as simple as:

  • define a price for an asset, say 100
  • have buyers and sellers randomly send orders at a limit +/- 10 cents of the current price
  • when a buy order meets a sell order (say a buyer wants to buy at 100.05 and a seller wants to sell at that price too), generate a transaction which gives a new price to the asset
  • loop

But from an implementation perspective, the (very) tricky part is in "buyers and sellers randomly send orders...".

You can also add exogeneous shocks (say an announcement) which modifies the balance of buyers vs. sellers, triggering a significant move in price (up or down).

다른 팁

Also, are there any existing java code that I can look at to get an idea?

I would be extremely surprised if you could get your hands on the source code of a real stock exchange system.

Having said that, I don't know if there is such a thing as an intrinsic value of a stock that is distinct from the price at which it is being bought and sold. Feel free to experiment, but you'd probably do better by researching the relevant Economics literature than looking for answers in code. You'd probably need a solid grounding in Economics just to understand the code.

(Bear in mind: if there is possibility of money to be made from an "intrinsic value" measure, the chances are that thousands of really smart people will have tried this already ...)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top