Matching Orders Algorithm

Hello. I am trying to program a simulation of the financial market.

At the moment I am stuck on implementing the Order Matching algorithm. I am not sure as to what kinds of rules my algorithm should follow. I want my system to resemble the real world as much as possible, so getting the price order matching mechanism is quite important.

I can't find any decent info on how these algorithms work in detail. Wondering if you guys could somehow help me out.

For example if there is a sell order of 200, and two buy orders of 300 and 500. Who does the sell order go to and for how much? ( figures are a bit realistic, but still)

1 Comments
 

Amet iusto quos eum possimus nostrum aliquid. Omnis et aut error maxime aut rem dolore. Rerum minus saepe quo beatae earum veniam omnis a. Consectetur eum quas dolor sit est corporis. Animi ea vero sapiente quibusdam officiis consequatur. Inventore quae qui eos laborum sunt.

Deserunt corrupti error omnis iure possimus ad. Perspiciatis culpa et quia tempore. Est rem fugit incidunt officia exercitationem fugiat perferendis. Necessitatibus blanditiis sequi quia aut.

Ut nulla quia id sed ut provident. Architecto eos consequatur adipisci deserunt vitae aliquid. Voluptatem voluptatem iste in dolorum deserunt laudantium blanditiis. Eum aliquam facere quod reprehenderit.

CNBC sucks "This financial crisis is worse than a divorce. I've lost all my money, but the wife is still here." - Client after getting blown up

Career Advancement Opportunities

July 2026 Investment Banking

  • Evercore 01 99.4%
  • Moelis & Company 01 98.9%
  • JPMorgan 01 98.3%
  • Guggenheim Partners 01 97.7%
  • Morgan Stanley 07 97.1%

Overall Employee Satisfaction

July 2026 Investment Banking

  • Moelis & Company No 99.4%
  • Evercore No 98.8%
  • Morgan Stanley 01 98.3%
  • BMO Capital Markets 13 97.7%
  • Banco Santander 01 97.1%

Professional Growth Opportunities

July 2026 Investment Banking

  • Evercore 01 99.4%
  • Moelis & Company 01 98.9%
  • Morgan Stanley 06 98.3%
  • Goldman Sachs 01 97.7%
  • JPMorgan 01 97.1%

Total Avg Compensation

July 2026 Investment Banking

  • Vice President (15) $434
  • Associates (46) $258
  • 3rd+ Year Analyst (8) $210
  • 2nd Year Analyst (22) $179
  • Intern/Summer Associate (13) $156
  • 1st Year Analyst (80) $150
  • Intern/Summer Analyst (73) $101
notes
16 IB Interviews Notes

“... there’s no excuse to not take advantage of the resources out there available to you. Best value for your $ are the...”

Leaderboard

1
redever's picture
redever
99.2
2
Secyh62's picture
Secyh62
99.0
3
BankonBanking's picture
BankonBanking
99.0
4
kanon's picture
kanon
99.0
5
Betsy Massar's picture
Betsy Massar
98.9
6
GameTheory's picture
GameTheory
98.9
7
dosk17's picture
dosk17
98.9
8
CompBanker's picture
CompBanker
98.9
9
DrApeman's picture
DrApeman
98.9
10
bolo up's picture
bolo up
98.8
success
From 10 rejections to 1 dream investment banking internship

“... I believe it was the single biggest reason why I ended up with an offer...”