Order Book: Who gets matched first? Order queuing/matching algo question...

Discussion in 'App Development' started by kmiklas, Jan 16, 2017.

  1. InvBox

    InvBox

    Matching process has various models. FIFO, by size at the best price, by best size at the best price... Depends of instrument + session.
     
    #11     Jan 18, 2017
  2. kmiklas

    kmiklas

    Can you recommend a good article source on matching methods?
     
    #12     Jan 18, 2017
  3. InvBox

    InvBox

    Most of exchanges provide it while direct connection. Not sure they have it in public access.

    BTW, some of brokers (like Interactive Brokers) has they own internal matching engine. Especially for short sell stock orders. A broker can fill it independently.
     
    #13     Jan 19, 2017
  4. TraDaToR

    TraDaToR

    #14     Jan 19, 2017
  5. Most exchanges work with Price/Time priority.
    Where price means that Bids and higher prices and Offers at lower prices get filled first.
    Then within each price level, the oldest order gets the first fill.

    But there are some that operate on pro-rata or Price/Size priority.
    In this case, within each price level when a block of shares comes to execute it is broken up into pieces and each order in the queue gets a piece, depending on the size of the order in the queue.
    So if there are orders for 5000, 3000, 2000 and the market order is for 1000 shares... it gets split up into 500, 300, 200 respectively.

    If we have several exchanges competing for that market order, then each exchange has it's own internal priority/line... but the trader sending that market order can choose which way to send it; there is no priority rule between exchanges, aside from price priority, only inside each exchange.
    If the market order is larger than the queue at one exchange then it has to route away, how this is done is different from market to market depending on regulations, agreements between exchanges and routing instructions submitted into the market order.
     
    Last edited: Jan 22, 2017
    #15     Jan 22, 2017