[R] Divide tick-data into intervalls

oswi3605 jeppf at mailinator.com
Tue May 8 10:14:35 CEST 2012


Hello, 

Im currently writing my bachelor thesis in statistical finance and i have
run into a small problem. I want to evaluate forcasts from my GARCH with
realized intraday volatility. The intraday data is Tick-data over a certain
period. The date column is presented as for example 2011-11-01 09:24:41 for
different points in time. The other column is with the stock prices at that
same time. What I want to do is to recieve the end courses of certain time
intervals. For example i want to know what the closing course if for every
five minute or ten minute interval in the sample. In other words, i want to
transform the tick-data into k-minute-interval data. 

I have been trying to this in the following way:
 
The data has been converted to a time serie and look likes:
 
price
 2011-11-01 08:00:00 0.000000000
 2011-11-01 08:00:00 0.000000000
 2011-11-01 08:02:00 0.000000000
 2011-11-01 08:03:00 -0.017033339
 2011-11-01 08:24:00 0.000000000
 2011-11-01 08:24:00 0.000000000
 2011-11-01 08:29:00 0.000000000
 2011-11-01 08:29:00 0.000000000
 2011-11-01 08:29:00 0.000000000
 2011-11-01 08:29:00 0.000000000
 2011-11-01 08:29:00 0.002166062
 2011-11-01 08:44:00 0.000000000
 2011-11-01 08:44:00 -0.002166062
 2011-11-01 08:44:00 0.004321374
 2011-11-01 10:36:00 0.010618976
 2011-11-01 15:59:00 0.002092990
 2011-11-01 16:21:00 0.000000000
 2011-11-01 16:30:00 0.004155960
 2011-11-02 08:00:00 0.000000000
 2011-11-02 11:50:00 0.000000000
 2011-11-02 13:38:00 -0.002073009
 
and so on for 108 days (this stock is a small cap company, and therefore the
infrequent trading)
I tried one coding option but it did not work even after much modification
of the coding, so i need a new approach. An answer in coding would be much
appreciated.

--
View this message in context: http://r.789695.n4.nabble.com/Divide-tick-data-into-intervalls-tp4616873.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list