After fixing bug in CleanHistory func I was able to build a simple OLS regression and plot the beta-adjusted spread between two stocks.