Asking for help on using Hull MA/Weighted MA

Hello I am attempting to modify indicators based off of the Hull Moving Average. I am not a programmer by profession so at first I was baffled at the behavior of the indicators I was using/modifying, please see the attached pic.

One is a copy paste of the ./tools/hma code called test hma. It is a direc


t copy and paste. The other is the HMA that is found in ./tools/hma. The blue line is the copy/pasted HMA code. I noticed that whenever WMA or HMA copied and not part of the /builtin or /tools folder I get this odd behavior. Can someone please tell me why this is? When tab in and out of a chart that uses this the lines become smooth again.

Somebody has to know the answer to this. its really irritating having to tab in and out of my chart to get the lines to stay smooth and correct.