Using Robinhood Instant as my broker, I have the following method for rebalancing my portfolio:
def rebalance_portfolio(context, SID):
order_target_percent(context.aapl,0)
order_target_percent(context.msft,0)
if SID =="AAPL":
order_target_percent(context.aapl,1)
elif SID == "MSFT":
order_target_percent(context.msft,1)
So I sell everything off first, then, my hope, is that I reinvest that money into AAPL or MSFT
My question is: will the money from the sell off be available to make purchases with on the next line of code. I understand that if my broker can't fulfill, then I won't be able to sell and I won't get that cash. If it does get filled immediately, can I expect the order_target_percent method to wait for Robinhood to credit that cash to my account immediately? Has anyone run into an issue with this? Just wondering if I should code for the possibility.
Note: I have a Robinhood Instant account so I'm not worried about the T+3 clearing time.