This code will test whether a stock has a significant alpha over the last 5040 calendar days. It will then calculate alpha and beta over each 30 day subinterval and test whether alpha in one period can be used to predict alpha in the next period. The time series of alphas and betas are also plotted. The code is here: time_series_alpha.
I have totally rewritten the pairs trade estimation period code. It will create a csv file in your working directory which has the average squared deviation, and the standard deviation of the squared deviations, for all pairs. The csv is sorted from lowest (best pair) to highest (worst pair) average squared deviation. The code is here estim_period.
See the R markdown page here: alpha_across_firms.