Question 3
For the Algorithmic Market Making case (port number: 25006), create a VBA program that does the following:
1) At the beginning of the case, the program posts a limit order to buy 250 shares at the best bid price minus $0.01 and a limit order to sell 250 shares at the best ask price plus $0.01. As a result, two orders are posted to the limit order book.
2) Whenever one of your limit orders is executed, the program automatically cancels the remaining limit order. Following the cancellation of the remaining limit order, the program automatically posts a limit order to buy 250 shares at the best bid price minus Q and a limit order to sell 250 shares at the best ask price plus Z. (If done correctly, your program will always have exactly two limit orders posted to the limit order book.)
3) Continue repeating step (2) until there are five seconds left in the case. At that time, cancel all limit orders, and if you still have a non-zero inventory position, close it out by placing a market order.
The Q and Z in Step (2) are a function of your share position P:
−500 ≤ ? ≤ 500 ⇒ ? = $0.01, ? = $0.01
−1250 ≤ ? < −500 ⇒ ? = $0.00,? = $0.02
500 < ? ≤ 1250 ⇒ ? = $0.02,? = $0.00
? < −1250 ⇒ ? = $0.00,? = $0.04
? > 1250 ⇒ ? = $0.04,? = $0.00
This way, your market-making program posts more aggressive sell limit orders and less aggressive buy limit orders when your share position is highly positive, and posts more aggressive buy limit orders and less aggressive sell limit orders when your share position is highly negative. The following function should be useful for this case: =RTD(“rit2.rtd”,,“ALGO”,”LIMITORDERS”).
This function counts the number of limit orders you have on the limit order book. Whenever this number does not equal two, your program should cancel all limit orders and resubmit two new limit orders according to the instructions given in step (2) above.
(Note: your solution to this question must be submitted via e-mail as a spreadsheet with macros (i.e. an xlsm file) by the deadline date. Also make sure that the workings in your spreadsheet and VBA code are clear and easy to follow.)