代写代考 ÿþMAFS 5270: Mathematical Market Micros

ÿþMAFS 5270: Mathematical Market Microstructure - Summer 2022
Assignment 2  Imbalance-Return Relationship at Microstructure Level
Due Date: 11:59pm, July 24, 2022
Introduction: This assignment contains two parts. In the first part, we propose a theoretical model regarding various stochastic processes related to the arrival of trades and calibrate the model with real trade data later on. In the second part, we calibrate and estimate a market impact model with historical tick data.

Copyright By PowCoder代写 加微信 powcoder

The total score for this assignment is 100 points. You need to hand in a report in which you should state clearly your steps of data analysis and reasoning, not just a result. You are encouraged to quote lines of your computer program if that can help you explain yourself (not too many, though). You can also attach your computer programs in your hand-in.
Part One:
Supposethatduringtimeinterval[5Ø,5Ø+5Ø),thenumberoftrades 5Ø(5Ø)followsa
Poisson process, with the arrival rate of 5Ø: 5Ø5Ø5Ø =5Ø =5Ø”5Ø5Ø(5Ø5Ø)5Ø 5Ø=0,1,...
(1) Note that 5Ø(5Ø) is not a function of time t. For each trade, we further assume that its
size 5Ø5Ø (5Ø = 1,2, ...) follows an exponential distribution, with the pdf being
f 5Ø , 5Ø = 5Ø1 5Ø ” 5Ø 5Ø , ( 2 )
while its sign 5Ø5Ø is assumed to follow a Bernoulli process, i.e.
5Ø 5Ø5Ø =1 =5Ø,5Ø 5Ø5Ø =”1 =1”5Ø. (3)
5Ø5Ø = 1 means the trade is buyer-initiated, and seller-initiated otherwise.
In this exercise, we assume that the three random processes mentioned above are
mutually independent. We also assume that 5Ø and 5Ø are uncorrelated, i.e. 5Ø5Ø
5Ø6Ü5Ø5Ø 5Ø5Ø,5Ø5Ø =0,5ØVÜ5Ø=85Ø. The intuition behind this assumption is that the current
trade size does not affect the size of any future trade. As for trade sign 5Ø5Ø , we assume that 5Ø6Ü5Ø5Ø 5Ø5Ø, 5Ø5Ø = 5Ø|5Ø”5Ø| (i.e., the sign correlation function is  time
symmetric ). From empirical evidences, the signs of consecutive trades can be highly clustered, especially for liquid stocks as well as in an emerging market, where  herding phenomenon is highly persistent due to the presence of large amount of retail investors.1
Thus, the trade imbalance within the time interval [5Ø, 5Ø + 5Ø) is
5Ø<Ü5Ø = 5Ø 5Ø5Ø 5Ø5Ø. (4) Question 1: (15 points) At any time 5Ø, given the above conditions and assumptions, what is the unconditional expectation and unconditional variance of 5Ø<Ü5Ø within the next time interval [5Ø, 5Ø + 5Ø)? That is, calculate 5Ø 5Ø<Ü5Ø 5ØNÜ5Ø 5Ø5Ø5Ø(5Ø<Ü5Ø). Question 2: (30 points) Using the trade data of SH600519 (see attached data files), calibrate parameters 5Ø, 5Ø, 5Ø and 5Ø. For the moment, you can set 5Ø to be 5 minutes, or 300 seconds. The observation windows [5Ø, 5Ø + 5Ø) for different time points 5Ø s can be overlapping or non-overlapping. By overlapping observation windows, one can collect more sample data for below analyses. Question 3: (20 points) In the  trade files attached for both SH600519 and SH601398, the column with header  BS indicates the sign of each trade, provided by the exchange and can be quite reliable. That is, if it is a  B , it records the trade as buyer-initiated; otherwise, seller-initiated. For trade data that such trade sign information is not provided (there are many markets where the exchange does not easily provide such information), one can estimate the sign of each trade using a relatively simple version of the so call  Lee and Ready Algorithm : for each trade, compare the trade price with its  prevailing quote; if the trade price is above the mid-quote of the prevailing quote, label this trade as a  buyer-initiated trade that has a sign of +1; if the trade price is below the mid-quote of the prevailing quote, 1 Note that the assumption of sign correlation in the form of 5Ø|5Ø"5Ø| may contradict the aforementioned assumption of Bernoulli process for trade signs; nevertheless, we use 5Ø|5Ø"5Ø| to make the derivation explicitly tractable and to reflect empirical evidence of trade sign clustering effect. label this trade as a  seller-initiated trade that has a sign of -1; if the trade price is exactly at the mid-quote, assign 0 to its trade sign. Note that mid-quote is defined here as the simple average of bid1 and ask1 of the order book. Please use the data provided to check that, for both SH600519 and SH601398, what is the accuracy of this simple version of the Lee and Ready algorithm, using the exchange-provided information in the column  BS as a benchmark. Please use as large sample size as possible from the attached files. Part Two: In this part, we will calibrate a simple market impact model using the data in the attached files. On any given trading day, the price return during the time interval [5Ø, 5Ø + 5Ø) can be calculated as 5Ø5Ø5Ø = <Ü5Ø5ØVÜ5Ø6Ü5Ø5Ø 5Ø+5Ø "<Ü5Ø5ØVÜ5Ø6Ü5Ø5Ø(5Ø). (5) <Ü5Ø5ØVÜ5Ø6Ü5Ø5Ø(5Ø) For the convenience in handling data, you could also try the following definition which, however, is not recommended, as it s sensitive to bid-ask bounce: 5Ø5Ø5Ø = 5Ø5Ø5Ø_Ü5Ø 5Ø+5Ø "5Ø5Ø5Ø_Ü5Ø(5Ø). (6) 5Ø5Ø5Ø_Ü5Ø(5Ø) A third way to calculate return series is to use  weighted mid-quote , in which case the MidQuote(t) is defined as the weighted average of bid1 and ask1 by the corresponding askSize1 and bidSize1: <Ü5Ø5ØVÜ5Ø6Ü5Ø5Ø(5Ø) = 5Ø5Ø5Ø1"5ØNÜ5Ø5Ø5ØXÜ5Ø1+5ØNÜ5Ø1"5Ø5Ø5Ø5Ø5ØXÜ5Ø1. (7) 5ØNÜ5Ø5Ø5ØXÜ5Ø1+5Ø5Ø5Ø5Ø5ØXÜ5Ø1 Using MidQuote(t) defined in this way will make the estimate of return series for large bid-ask spread stocks more meaningful as, for such large bid-ask spread stocks, the mid-quote calculated from simple average of bid1 and ask1 rarely changes in time. Note that the MidQuote(t) and Ret defined in (5) and (7) must be calculated using the  quote data files attached. The trade imbalance within the time interval [5Ø, 5Ø + 5Ø) is calculated as 5Ø<Ü5Ø = 5Ø 5Ø5Ø 5Ø5Ø. (8) 5Ø=1 5Ø Here 5Ø is the first moment of the whole sample. Please note that the difference between equation (8) and equation (4). We will use equation (8) for the definition of imbalance going forward. The relationship between 5Ø5Ø5Ø and 5Ø<Ü5Ø can be formulated as 5Ø5Ø5Ø = 5Ø5Ø5Ø5Ø5Ø5Ø5Ø<Ü5Ø|5Ø<Ü5Ø|5Ø , (9) where 5Ø5Ø<Ü5Ø = 1 5ØVÜ 5Ø<Ü5Ø > 0 5ØNÜ5Ø ” 1, 6Ü5Øh5Ø5Ø5Ø5ØNÜ5Ø.
To capture the asymmetric effect of buys vs. sells, the model is slightly extended as 5Ø5Ø5Ø=5Ø+5Ø5Ø5Ø5Ø 5Ø<Ü5Ø5Ø+,5ØVÜ5Ø<Ü5Ø>0,and5Ø5Ø5Ø=5Ø”5Ø5Ø5Ø5Ø 5Ø<Ü5Ø5Ø",5ØVÜ5Ø<Ü5Ø<0. (10) In both (9) and (10), 5Ø5Ø5Ø5Ø is the volatility of the stock; it can be calculated (among other ways) as the standard deviation of the time series of returns defined in (5) and (7); it should be calculated across the whole sample period. parameters: 5Ø , 5Ø , 5Ø and 5Ø in formulas (10) for two cases: (1) 5Ø = 5 minutes, or 300 seconds; (2) 5Ø = 1 minutes, or 60 seconds. Check if there are significant differences between the two cases and comment on them, if any. Question 4 (35 points): For both SH600519 and SH601398, calibrate the four +"+ " Hint for Question 4: Due to the noisy nature of the data, direct linear regression applied to all observations in (9) or (10) will render a model that has rather low R square. To increase the R square statistic, one can  bin the data in  buckets of values of IMB. For example, one can form groups of observations by quantiles of IMB, then average all the Ret values in each group. After that, one can regress on such average values of Ret on the quantile values of IMB to obtain a model. Note on the Data: Note1: The data covers more than one year s tick-by-tick trade data and quote data of two stocks from the Shanghai Stock Exchange that are key members of the CSI300 index, a major equity index for the local market. They re SH601398 (ICBC), and SH600519 (Kweichow Moutai). The price of SH601398 has relatively small intraday variations, while the price of Moutai stock can exhibit high fluctuations. You may get quite different empirical results for these two stocks. Note2: As mentioned earlier, when calculating high-frequency returns for ICBC, it will be The most common one is (5Ø5Ø5Ø15Ø5Ø5Ø_Ü5Ø + 5ØNÜ5Ø15Ø5Ø5Ø_Ü5Ø)/2. But this is not best if you use mid-quote. However, there re also several definitions for mid-quote. following volume weighted mid-quote definition is a better choice: <Ü5Ø5ØVÜ5Ø6Ü5Ø5Ø = 5Ø5Ø5Ø15Ø5Ø5Ø_Ü5Ø"5ØNÜ5Ø15Ø5ØXÜ5Ø+5ØNÜ5Ø15Ø5Ø5Ø_Ü5Ø"5Ø5Ø5Ø15Ø5ØXÜ5Ø recommended for ICBC because it may stay fairly constant throughout the day. The 5Ø5Ø5Ø15Ø5ØXÜ5Ø+5ØNÜ5Ø15Ø5ØXÜ5Ø End of assignment 3. Copyright © by Dr. Hongsong Chou, 2012-2022. No part of this material may be: (i) copied, photocopied, or duplicated in any form, by any means, or (ii) redistributed without prior expressed consent from the author. The views expressed here are those of the author himself and himself only. 程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com