[R-SIG-Finance] quanstrat rule to exit same day close (using daily data)

algotr8der algotr8der at gmail.com
Sat May 12 23:45:39 CEST 2012

I am trying to backtest a strategy that requires an exit on the close (same
day as the entry).  I have searched through Rmetrics and stackoverflow and
found the following post:


Brian Peterson said the following:

>quantstrat, as described in the manual, is a signals-based framework. It is
not designed for filters based trades really.

>You could do what you want by using the delay argument to your exit rule.
Set the delay to be one day, and the prefer
argument to prefer a different price column.

>I'm not going to write it for you, but that is enough information to solve
your problem.

Now this was a solution to exit at a future time stamp. I want to exit the
*same* day (I am using daily data for my test) which is why I'm not sure if
setting a delay really works for what I want to do. Is this at all possible?

Appreciate the direction.

View this message in context: http://r.789695.n4.nabble.com/quanstrat-rule-to-exit-same-day-close-using-daily-data-tp4629612.html
Sent from the Rmetrics mailing list archive at Nabble.com.

More information about the R-SIG-Finance mailing list