Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Weekly Rebalance

I am trying to test a buy and hold portfolio with rebalancing. Does anyone know how to achieve a weekly rebalance for the stocks in the portfolio. My current allocation is equal weight, but it would be nice to have the ability to rebalance to other weights as well. Any help would be much appreciated.

2 responses

Co B,

You'll find an example of daily portfolio re-balancing here:

https://www.quantopian.com/posts/olmar-implementation-fixed-bug

The re-balancing on a weekly basis can be achieved with an if-then statement (e.g. "if it is noon on a Monday, then re-balance). I don't have time right now to work up an example, but it is straightforward.

Are you wanting to maintain a specific portfolio balance? For example, a 10%/20%/30%/40% mix of 4 securities?

Grant

Hi Grant,

That is exactly what I am trying to. Thanks for your help, but I have never used python before and am still a bit confused on how to make this work.