Most likely a two-step process.
Step 1 ---> create a new datetime index with five minute intervals
Step 2 ---> use the new datetime index to aggregate columns appropriately
Questions regarding Step 1:
For the five minute interval 31MAR16:00:00:00, is this supposed to contain minutes 00, 01, 02, 03, and 04 on 31MAR16? Similarly, is 31MAR16:00:05:00 supposed to contain minutes 05, 06, 07, 08, and 09 on 31MAR16, and so on? If correct, the code below creates the new datetime index. If incorrect, please explain.
data idx_create;
set BTC;
do i=0 to 55 by 5;
dateidx = ifn(i<=minute(time_start)<=i+4,dhms(datepart(time_start),hour(time_start),i,0),dateidx);
end;
format dateidx datetime22.;
run;
With respect to Step 2, please explain what you're looking for in the following columns and use the new datetime index value 31MAR16:00:00:00 to talk through the logic for how each column should be calculated.
High = maximum value of High column among the 5 observations in each new datetime index value
Low = minimum value of High column among the 5 observations in each new datetime index value
Exchange = ?
Market = ?
Open = ?
Close = ?
Volume = ?
... View more