Hey, thanks again for your help!
There was a small issue where applying any shift value made the MA line disappear. After checking the code with ChatGPT help, I found the fix:
the shift parameter inside iMA() had to be 0, since we're already applying the visual shift through PlotIndexSetInteger().
I’ve attached the corrected version here if anyone wants to use it too. Cheers!