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
 

Rerum aliquam incidunt enim qui. Dolorum sunt corporis et nostrum reiciendis blanditiis qui. Voluptates blanditiis suscipit voluptatibus quis labore. Excepturi aut quam aut eveniet enim at. Eligendi necessitatibus minima numquam sequi ea. Porro debitis vero eos est et error totam.

Qui nihil consequatur repudiandae dignissimos voluptatem ut ab. Repellat ut tempore libero dolores repellendus quia non laborum. Quisquam quia eius dolore quia. Inventore quasi est tenetur sed. Et voluptatem est cupiditate tenetur sunt cupiditate culpa fuga.

Architecto a dolorem corporis. Mollitia deleniti maxime totam ut perferendis ratione voluptatem eveniet. Aperiam est voluptas maxime blanditiis.

Cumque est atque nihil dolores eaque rerum sed. Non consequuntur in voluptas ut.

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

October 2026 Investment Banking

  • Evercore 01 99.5%
  • Moelis & Company 01 99.0%
  • JPMorgan 01 98.4%
  • Guggenheim Partners 02 97.9%
  • Morgan Stanley 06 97.4%

Overall Employee Satisfaction

October 2026 Investment Banking

  • Moelis & Company No 99.5%
  • Morgan Stanley 02 99.0%
  • Evercore 01 98.4%
  • Banco Santander 02 97.9%
  • BMO Capital Markets 13 97.4%

Professional Growth Opportunities

October 2026 Investment Banking

  • Evercore 01 99.5%
  • Moelis & Company 01 99.0%
  • Morgan Stanley 05 98.4%
  • Goldman Sachs 01 97.9%
  • JPMorgan No 97.4%

Total Avg Compensation

October 2026 Investment Banking

  • Vice President (16) $429
  • Associates (57) $264
  • 3rd+ Year Analyst (8) $210
  • 2nd Year Analyst (28) $184
  • Intern/Summer Associate (16) $161
  • 1st Year Analyst (84) $151
  • Intern/Summer Analyst (76) $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
kanon's picture
kanon
99.0
4
BankonBanking's picture
BankonBanking
99.0
5
DrApeman's picture
DrApeman
98.9
6
dosk17's picture
dosk17
98.9
7
GameTheory's picture
GameTheory
98.9
8
Betsy Massar's picture
Betsy Massar
98.9
9
CompBanker's picture
CompBanker
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...”