[R-SIG-Finance] quantstrat - model transactions on specific dates

Brian G. Peterson brian at braverock.com
Thu Oct 9 23:16:28 CEST 2014


On 10/09/2014 04:00 PM, Mark Knecht wrote:
> Best I can
> tell the applyStrategy.rebalance function rebalances individual stocks
> based on the last entry date of that stock but not, for instance, on a
> specific date like the a calendar quarter. (I wasn't going to post
> this all right now until I was really sure so don't take this too
> seriously.) Anyway I want to write something like what Faber &
> Richardson wrote about in 'The Ivy Portfolio' where the whole
> portfolio is rebalanced on a given date, like end-of-month,
> independent of whether I'm using the 10 month SMA or not. For that
> reason I figured I might need a way to match indexes to dates going
> though time.

see the faber_rebal demo.

The rebalance_on argument will call the rebalancing rule(s) on whatever 
periodicity you tell it to, you'll have to have something for them to do.

In the demo, I just changed max order size, but there's no reason you 
couldn't write a (strategy specific) rebalancing rule that wouldn't read 
all the positions, and do transactions on the rebalance date.

Regards,

Brian

-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock



More information about the R-SIG-Finance mailing list