I wish to rebalance every n days … say for example every 12 days.  How would I do this?  ChatGPT said to do the following:

self.Schedule.On(self.DateRules.Every(timedelta(days=12)),self.TimeRules.AfterMarketOpen("SPY"), self.Rebalance)

But this doesn't appear to work. It appears as though you must end up with a fixed period from what I have gathered. 

I suspect I must manually keep track of how many days since the last rebalance and if it hits n then rebalance but I am wondering if there is an “easier” preprogrammed way to do this.