Generally it's not a good idea to save pricing, volume, and factor data from day to day. The reason is these won't be adjusted properly for splits and dividends. One other issue is securities returned by the pipeline may change from day to day. The saved securities from yesterday may not match the securities from today so there will be missing values. It's best to simply re-calculate the values each day. In this case, calculate the RSI from the previous day.
So, I'd suggest writing a custom factor that returns the previous days RSI. A great starting place is to look at the code for the built in RSI factor (https://www.zipline.io/_modules/zipline/pipeline/factors/technical.html ). Most of the Quantopian code is open sourced in a package called zipline. Simply google something like "RSI zipline" and one should be able to find it.
So, with a little shameless cut and paste from the zipline code and several adjustments, something like this should work
class PreviousRSI(CustomFactor):
# Define inputs
inputs = [USEquityPricing.close]
# Set rsi_window and lookback to whatever number of days one wishes
# The default is a 15 day RSI from 1 day ago.
rsi_window = 15
lookback = 1
window_length = rsi_window + lookback
def compute(self, today, assets, out, closes):
# Use data from beginning of window to 'lookback' days ago
diffs = np.diff(closes[:-self.lookback], axis=0)
ups = np.nanmean(np.clip(diffs, 0, np.inf), axis=0)
downs = abs(np.nanmean(np.clip(diffs, -np.inf, 0), axis=0))
out[:] = 100 - (100 / (1 + (ups / downs)))
One note. The RSI factor actually is 'window safe' meaning that it won't be affected by splits and dividends so technically it can be saved. However, it's probably just as easy to re-calculate and also won't have the missing security issue.
Finally, FYI the 'data.history' function DOES work with the entire universe of stocks.
Attached is a notebook showing the custom factor in action. Post if you need help getting it to work in your algo. Good luck.