Essentially, every 30 minutes, a custom function that calculates and outputs a list of weights is executed. Then that list of weights would be used for the target percentage of the corresponding securities. Then "wait" for 30 minutes, then close all the positions, then repeat. So in practice would be to open the positions, wait for 30 minutes, then close all the positions, then immediately find the new optimal target percentages and repeats.
My understanding is that if I were to include "order_target_percent" in the handle_function, then it would be executed every minute, thus would be near constantly rebalancing the weights which is not what I'm looking for.
How do people approach this?
I was thinking of declaring a global variable such that for every time handle function is executed, that global variable will increment by 1 and if it's divisible by say 30, then it executes the custom functions. But how would it actually execute the custom functions tho?
as far as I know, there is no feature for that for schedule_function