I am able to calculate the rolling regression of time series data in such a fashion:
data[,linRegST:=roll_lm(close,date,10)$coefficients[,c("x1", "X.