Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How to buy in several days if the order is too big to be filled in 1 day?

Hello everyone,
I am trying to make a sector rotation algorithm (attached) but when the amount invested is too big (10,000,000$) then the orders are to big to be filled in one day. My algorithm seems to close these orders at the end of the day, but I want to buy until the target is reached. Anyone can help please?

1 response

Maybe try separating your 'rebalance' code from the actual 'order' code. Have the 'rebalance' logic simply set target weights of each security. Have the 'order' code do the actually order execution to achieve those weights. In the above algorithm, schedule the 'rebalance' code to run monthly but schedule the 'order' code to run every day. The order logic should then keep ordering across several days to achieve the desired weights.