Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Custom rebalance using date_rules

With date_rules, the following are available:

  • every_day()
  • week_start(days_offset = 0-4)
  • week_end(days_offset = 0-4)
  • month_start(days_offset = 0-25)
  • month_end(days_offset = 0-25)

I'd like to use date_rules to allow for a quarterly or annual rebalance but based on the options available, this is not possible. Has anyone made this work or found another solution?

3 responses

I am also interested in doing this. If there is a known solution, please advise.

Thanks.

David,

Attached is one way to use the built in get_datetime() function to trade monthly, quarterly and/or annually. Maybe that helps? There are also a number of posts that address similar scheduling needs. Search for 'get_datetime' or 'schedule' and you will find some more.

https://www.quantopian.com/posts/rebalancing-less-frequently-than-1-month-help
https://www.quantopian.com/posts/using-schedule-function-every-day-but-mondays-possible

Good luck,

Dan