Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Is this another way to handle Robinhood's 3 day rule for cash settlement?

So below is some really rough pseudo code and I haven't tried this yet because I won't have time until this evening. However maybe someone else can get to it first. I don't really like how I've seen cash handled in other Robinhood algorithms but I'm surprised I haven't seen this done before so maybe it won't work.

#Robinhood 3 day rule solution

initialize  
     context.bucket1= []  
     context.bucket2= []  
     context.bucket3= []

schedule before market opens  
     move values to the next bucket  
     clear bucket3

handle_data  
     cash = context.portfolio.cash - sum(context.bucket1) + sum(context.bucket2) + sum(context.bucket3)  
     #trading logic goes here.  
     #after a sell order  
          add earnings to context.bucket1
3 responses

Are you trying to avoid the round-trip rule? Without leverage rights, it would typically take 3 days to settle a trade and free up the cash for another trade. This is a FINRA rule for retail accounts.

@Jon Taylor, No I just don't want an account that has cash but also unsettled funds to be completely tied up for 3 days in Robinhood.

Robert,
I'm interested in finding a solution to this problem too. In all the Robinhood algorithms I've seen, when simulating a backtest, all trading is blocked until the the funds from a previous sale are settled (T+3). This seems stupid to me because is most cases you would still be able to trade with the settled cash you have while you wait for the unsettled cash.

During live trading most Robinhood algorithms have a do_unsettled_funds_exist check, and when true, will not allow trading. I would think to avoid this, you could just get rid of this check, and assign the money you trade with as context.account.settled_cash , which would only allow you algo to trade settled funds. If this logic is correct, then this problem is solved during live trading. But I still haven't figured out a way to simulate the T+3 rule during backtesting, while still allowing the algo to trade if unsettled funds exist, by only trading with settled funds. But I do find your pseudocode as a promising start. If could help turn this idea into a reality that would be awesome.