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)

 

Modi aliquam nemo reprehenderit pariatur quia. Quo veritatis officia reiciendis ut ratione. Dolores eveniet vel maiores illum et voluptas assumenda. Et quis ut ex.

Sed veniam illum corrupti explicabo laboriosam voluptas. Aut sed mollitia eveniet ea sint. Voluptatem excepturi aut cumque perspiciatis impedit non omnis. Nam maiores est eveniet sit vero praesentium illo nihil.

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

April 2024 Investment Banking

  • Jefferies & Company 02 99.4%
  • Goldman Sachs 19 98.8%
  • Harris Williams & Co. New 98.3%
  • Lazard Freres 02 97.7%
  • JPMorgan Chase 03 97.1%

Overall Employee Satisfaction

April 2024 Investment Banking

  • Harris Williams & Co. 18 99.4%
  • JPMorgan Chase 10 98.8%
  • Lazard Freres 05 98.3%
  • Morgan Stanley 07 97.7%
  • William Blair 03 97.1%

Professional Growth Opportunities

April 2024 Investment Banking

  • Lazard Freres 01 99.4%
  • Jefferies & Company 02 98.8%
  • Goldman Sachs 17 98.3%
  • Moelis & Company 07 97.7%
  • JPMorgan Chase 05 97.1%

Total Avg Compensation

April 2024 Investment Banking

  • Director/MD (5) $648
  • Vice President (19) $385
  • Associates (87) $260
  • 3rd+ Year Analyst (14) $181
  • Intern/Summer Associate (33) $170
  • 2nd Year Analyst (66) $168
  • 1st Year Analyst (205) $159
  • Intern/Summer Analyst (146) $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
BankonBanking's picture
BankonBanking
99.0
3
Betsy Massar's picture
Betsy Massar
99.0
4
Secyh62's picture
Secyh62
99.0
5
CompBanker's picture
CompBanker
98.9
6
kanon's picture
kanon
98.9
7
dosk17's picture
dosk17
98.9
8
GameTheory's picture
GameTheory
98.9
9
numi's picture
numi
98.8
10
Jamoldo's picture
Jamoldo
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...”