Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Call Auction and Order Book

Advanced Quantitative Analysis in Finance

Exercise  1.  Call Auction.  With the Excel spreadsheet distributed in class, showing how the call auction works, write a general purpose call auction computer program in Python that does the following:

❼ Read from a file the buy and sell orders.  Fields within the file should consist of the price, side, quantity.

Determine the opening price, i.e.  the price that matches all buy and sell pre-orders.

❼ Determine the initial opening order book after the call auction.

Exercise  2.  Order Book. Using your knwledge of Python which has built in data structures for lists and dictionaries, develop a Python class named OrderBook, that can model and store an order book. Please note the following:

❼ OrderBook should be able to handle both the bid and ask sides.

❼ OrderBook should be able to handle both market and limit orders.  A market order should be matched immediately, while the limit order may or may not be filled fully. A partially filled or totally unfilled order becomes part of the order book.

❼ Any any time, be able to output the best bid, best ask, bid/ask spread, and all market depth.

❼ Any any price, ensure time priority of orders by matching orders that were placed first.