Answer the question
In order to leave comments, you need to log in
How to create a stock trading simulator?
I conduct a training for students in which they trade stocks among themselves. At the moment, the format of the holding is like on the old exchanges, where traders on the site (in the pit) shouted out their offers and made deals. I would like to automate the process.
How the simulator works: students submit bids with the price and number of shares they want to buy or sell. This information is displayed to all bidders. They can accept the application, thus making a deal.
The question concerns rather even architecture. Interested in how best to build a simulator and what skills / tools are needed for such a solution. My programming experience is limited to simple python programs, but I am ready to master the necessary knowledge.
Answer the question
In order to leave comments, you need to log in
To build a stock trading simulator, you need to be able to play the stock market. Know and understand what is needed. And not to own koderstvo.
Architecture on the knee - users place orders (quantity - price), then they are processed by a separate exchange demon, which checks new orders, if they matched in price - makes a deal, increasing the balances of the buyer and seller.
All of this can be done on the web. There is a server, there are clients that connect to the server with sockets (there is at least node.js, at least python, whatever your heart desires). Clients (browser) send you either a "ticker - side - price - quantity" order or a request to withdraw the order. An application has come - assign it an ID, save it. Or delete the application for the incoming id. Based on this, you collect order books for each symbol on the server. When changing the order book, you send either only the change, or (more simply) the entire snapshot of the order book to all connected clients. All.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question