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)

 

Ipsa neque enim tempora at officiis tenetur odio. Qui maiores natus consequatur nulla. Veritatis esse sed nesciunt voluptatem molestias sed. Officia ut aut autem beatae amet voluptatum veniam.

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 (86) $261
  • 3rd+ Year Analyst (14) $181
  • Intern/Summer Associate (33) $170
  • 2nd Year Analyst (66) $168
  • 1st Year Analyst (205) $159
  • Intern/Summer Analyst (145) $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

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...”