In general, Zorro is lighting fast, as long you don't do something stupid, it is fast enough laugh

Please check, if the following is, what you need, and search for "linear regression" in the manual, you will find some stuff there too.

Code:
function run(){
StartDate= 20060101; 
BarPeriod = 1440;
LookBack = 1000 ;

vars Price = series(price());
 

vars linreg = series(LinearReg(Price, 1000));
 
plot("linreg", linreg[0],MAIN, BLUE); 
 
}