I wanted to implemented the code but got the message that Moving Average Period, Angle Threshold, Sample Period (period used to calculate the signal line) are not defined.
Small hint for a next time : Commenting-out means that the code is deactivated by means of making a comment of it. Thus in this PRT case : preceding the code lines with two slashes (not backslashes).
So what is meant is that those three lines must be activated. Not that that is “commenting-in” that I know of … 🙂
Remove the slashes.