Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Portfolio with different schedule for different positions

Hello, I'm trying to figure out how to run a momentum strategy where each week of the month, one quarter of the portfolio gets rebalanced. In essence:

List of Stocks = A, B, C, D
Month 1, Week 1: Calculate stock with highest momentum for past 30 days and buy with 25% of portfolio balance
Month 1, Week 2: Calculate stock with highest momentum for past 30 days and buy with 25% of portfolio balance
Month 1 Week 3: Calculate stock with highest momentum for past 30 days and buy with 25% of portfolio balance
Month 1 Week 4: Calculate stock with highest momentum for past 30 days and buy with 25% of portfolio balance
Month 2 Week 1: Sell Month 1, Week 1 holding and buy stock with highest momentum for past 30 days and buy with 25% of portfolio
Month 2 Week 2: Sell Month 1, Week 2 holding and buy stock with highest momentum for past 30 days and buy with 25% of portfolio
etc...

I see multiple references to rebalancing on multiple timeframes (beginning and end of day, multiple times per month, etc...), but I'm stumped on how to only swap out a set part of the portfolio on a given week.

Any thoughts would be appreciated.

Thanks,
Nathan