This indicator returns a series unlike most other indicators. I also notice that the code uses lots of series where they aren't strictly necessary. So in the interest of learning here is my version that returns a single value, uses fewer series, and limits the length of the series used (except for the streak series).

I didn't limit the length of the streak series because that changes the indicator output, probably because the RSI calculation uses EMAs.

Code:
var CRSI(vars close, int rsiPeriod, int streakRsiPeriod, int percentRankPeriod) 
{
	vars streak = series(0);
	vars returns = series((close[0]-close[1])/close[1], percentRankPeriod);

	if (close[0] > close[1])
		streak[0] = max(1, streak[1] + 1);
	else if (close[0] < close[1])
		streak[0] = min(-1, streak[1] - 1);
	else // (close[0] == close[1])
		streak[0] = 0;
	
	var rsi = RSI(close,rsiPeriod);
	var streakRsi = RSI(streak,streakRsiPeriod);
	var rank = PercentRank(returns,percentRankPeriod,returns[0]);
	
	return (rsi + streakRsi + rank)/3;
}