FTEC5530 Assignment I. Calculation of Stock Market Micro-structure
Tick data sample(trade and quote) is provided in the month of 2020 Dec(trade.csv and
quote.csv)
1. Estimate the Average Daily Volume (ADV), Average Daily Turnover (ADTV) and daily
volatility (Annualized), average spread, avg quote size of each stock in the month of 2020
Dec. (score: 40% )
Result should be in a format like below:
Stock ADV ADTV
Daily
Volatility Spread (bps) Quote Size
000001.SZSE
600030.SHSE
Hint: generate daily data from trade and quote and perform above calculations
2. Generate the intraday market micro-structure report for stock 600030, draw the every 5-
min intraday chart for volume profile, intraday volatility(normalized to one
day)/spread/quote size profile (score: 60% )
Format sample:
time intradayVolatility spread quoteSize volpct
9:25 0.5%
9:30 4.3% 7.8 17,871 4.6%
9:35 3.4% 7.3 20,000 4.2%
9:40 2.8% 6.7 22,660 3.4%
9:45 3.5% 6.8 19,209 3.4%
9:50 2.7% 6.6 23,124 2.9%
Hint: generate minutely data from the raw and quote data, and perform calculation.
Kdb sample code:
t: ("DSTFF";enlist ",") 0:`$"c:/temp/trade.csv";
q: ("DSTFFFF";enlist ",") 0:`$"c:/temp/quote.csv";
q: select from q where time within (09:30;11:29:59.999) or time within (13:00;14:59:59.000);
//remove auction quote
Requirement:
Provide both of your code script (python/R/MATLAB/KDB or other languages) and result. KDB is
请加QQ:99515681 邮箱:99515681@qq.com WX:codehelp