Use a modulo calculation and a diff ... negative diff -> jump over frame
.....
On Jul 7, 2011 10:29 PM, "Noah Silverman" <noahsilverman@ucla.edu> wrote:
> Hi,
>
>
> I have a big dataset of tick data. (Actual transactions at sub-second
frequency)
>
> I've used R to convert this to an xts object.
>
> Iterating through the series to simulate a trading day.
>
> I'd like to know when a particular transaction is "on the minute" or "on
the 5 minute" mark. Of course, I can use all the great functions of xts to
convert the series to bars of any frequency, but that's not what I want. I'd
like to iterate over all the transaction and then somehow know when I've hit
a bar boundary.
>
> One possible issue is if I don't have a transaction exactly at the bar.
(More of a theoretical question.) For example, If I have a transaction at
11:59:59, and then the next transaction is at 12:00:01. Then no transaction
occurred exactly on the 1 minute boundary. I'm not sure the best way to
handle this.
>
> The general "big picture' concept is that a trading strategy might only
want to trigger on 5 minute bars, but I'd like to keep updating some of my
indicators as individual trades flow in.
>
> Thoughts?
>
>
> --
> Noah Silverman
> UCLA Department of Statistics
> 8117 Math Sciences Building
> Los Angeles, CA 90095
>
> _______________________________________________
> R-SIG-Finance@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
should go.

	[[alternative HTML version deleted]]

