I'm just guessing, so it would be nice if someone else could confirm or refute this.
if you insert the following at rows 18/19, you can at least see what is happening to your cash:
def handle_data(context, data):
As you'll see, the cash balance goes from $100k to -$651k almost immediately.
I added a counter to the loop, and it looks like your subset of the universe is around 180 stocks. When you initially cycle through the portfolio, your cash will not change after you place an order but will only be reduced once the order has been executed, which should be observable at the next bar.
Putting another counter in line 25 of your code in the rsi long loop, I can see that the initial execution was to buy 37 tickers on 2008-01-25. Given that you are buying $20k per ticker, that would be about $740k. Starting cash of $100k - $740k = -$640k, so we are in the ballpark with the -$651k observed earlier.
I'm not sure what mechanisms Quantopian has in place to fail executions once cash has been depleted.