I have trade data generated by a trading simulation software. The data is irregularly spaced w.r.t time i.e. trades are reported whenever they occur. For example, one trade occurs at 09:36:19 AM and then another trade occurs at 09:43:29 AM. Moreover, there may be multiple trades in the same instant. Thus, the time interval between two consecutive trades is unequal. In addition to the trade price, I have bid price, offer price, and the trade's volume. There are two types of time variables; one is the actual time of trade (Trade Time) in the format %tcHH:MM:SS while the other is named as "Event Time", which is just an integer with no units.

I want to estimate Intra-day Volatility for this data. I believe that the Autoregressive Conditional Duration (ACD) model of Engle and Russell (1998)* would be appropriate for this irregularly spaced data.

I am using Stata 14.2. The data looks in Stata as follows:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input double Price byte Volume double TradeTime int EventTime double(Offer Bid)
20.1 33      -1893421728000    72 20.1 19.9
20.2  7      -1893421529000   275 20.2 19.9
20.2 21 -1893421421000.0002   382 20.2 19.9
20.2 24 -1893421421000.0002   383 20.2 19.9
20.2 18 -1893421421000.0002   383 20.2 19.9
  20 28      -1893420991000   813 20.2   20
20.2 33 -1893420846999.9998   957 20.2   20
20.3  4 -1893420846999.9998   957 20.2   20
  20 22      -1893420506000  1297 20.3   20
  20 11      -1893420506000  1297 20.3   20
20.2 29      -1893420023000  1781 20.2   20
20.3  3      -1893420023000  1781 20.2   20
  20  4      -1893419951000  1852 20.3   20
20.1 35      -1893419288000  2516 20.3 20.1
  20 34      -1893419288000  2516 20.3 20.1
20.2  4 -1893418856999.9998  2946 20.2   20
20.2 16      -1893418624000  3179 20.2   20
  20 49      -1893418499000  3305 20.2   20
  20  5      -1893418301000  3503 20.1   20
  20 24      -1893418301000  3503 20.1   20
  20 26      -1893417458000  4346 20.1   20
  20 25      -1893417458000  4346 20.1   20
  20 22      -1893417458000  4346 20.1   20
20.1 34      -1893417206000  4597 20.1   20
20.2  7      -1893417206000  4598 20.1   20
20.2  7      -1893417206000  4598 20.1   20
  20 12      -1893416919000  4884 20.2   20
19.9 13      -1893416919000  4884 20.2   20
19.9 11      -1893416507000  5297 20.2 19.9
19.9  4      -1893416507000  5297 20.2 19.9
  20 20 -1893416220000.0002  5584 20.2   20
  20 48      -1893415612000  6191 20.2   20
  20 12      -1893414712000  7093 20.2   20
19.9 13      -1893414712000  7093 20.2   20
  20 33 -1893413922000.0002  7882   20 19.9
20.1 16      -1893413402000  8403 20.1   20
20.2 12      -1893413402000  8403 20.1   20
20.1 22      -1893412686000  9118 20.1   20
20.1 16      -1893412614000  9190 20.1   20
20.2  7      -1893412614000  9190 20.1   20
20.3 17      -1893412614000  9190 20.1   20
20.3 14      -1893412614000  9190 20.1   20
20.3 18      -1893412614000  9191 20.1   20
20.3  6      -1893412488000  9316 20.3   20
20.3 44      -1893412488000  9316 20.3   20
20.3 15      -1893412488000  9316 20.3   20
20.1 21 -1893411932000.0002  9872 20.2 20.1
20.1 24      -1893411860000  9944 20.2 20.1
20.1 17      -1893410927000 10877 20.2 20.1
  20  7      -1893410927000 10877 20.2 20.1
  20 25      -1893410837000 10967 20.2   20
20.2 19      -1893410443000 11362 20.2   20
20.2 33      -1893410245000 11559 20.2   20
end
format %tcHH:MM:SS TradeTime

My question is whether intra-day volatility can be estimated in Stata using an ACD Model. If possible, how it should be done? Specifically, I want to calculate volatility for each 15-minute or 30-minute interval.




* Autoregressive Conditional Duration: A New Model for Irregularly Spaced Transaction Data, by Robert F. Engle and Jeffrey R. Russell; Econometrica, Vol. 66, No. 5 (Sep., 1998), pp. 1127-1162