Try this and see if it runs faster
Col Moving Average( :x, 1, 999999, 0 )
Look into the Scripting Index for documentation and example
Or, you might try this, which eliminates the requirement to calculate the mean for a list of 100000 rows for each row's calculation, and cut it down to a single subtraction, a single addition, and one division.
If( Row() == 1,
theLag = 100000;
theSum = Sum( :x[Index( 1, theLag )] );
);
If(
Row() < theLag, theAvg = Col Moving Average( :x, 1, theLag, 0 ),
Row() == theLag, theAvg = theSum / theLag,
theAvg = ((theSum - :x[Row() - theLag]) + :x) / theLag
);
theAvg;
Jim