Linear regression slope - Code

 
Does anyone have the MQL4 code for a Linear Regression Slope (oscillating around zero, and not to be confused with the Lin Reg Indicator or Lin Reg Trendline), or alternatively for the very similar Moving Slope Rate of Change?

Ideally I’d like to cut and paste the code from a WORD document straight into a custom indicator.

Many thanks for your help or suggestions.

Duncan.