You can take a look of my thread as an example, appreciate if you can share your thoughts as well as I am encountering an obstacle in ensuring the correct execution of rebalancing with that loop function