Ok! I finally figured it out!. The correct code is as below. Thanks everyone for trying!
Inputs: FastLength(12), SlowLength(26), SignalLength(9);
Variables: FastMA(0), SlowMA(0), MACD(0), Signal(0), MACD_3(0), Signal_3(0), FastMA_3(0), SlowMA_3(0);
FastMA = XAverage(Close, FastLength)...