Help me learn AFL

#1
My code :

FastPeriod = 12;
SlowPeriod = 26;
SignalPeriod = 9;
macd = MACD(Close, FastPeriod, SlowPeriod); // Error 61
signal = EMA(macd, SignalPeriod); //Error 61

I am testing this code with error 61 syntax error .
Please help my correct it.
 
#2
Couple of points
1. macd and signal are function call and you are using them as variables
2. check the parameter which should be passed to relevant function in the help file.

Below is the modified code.

Code:
FastPeriod = 12;
SlowPeriod = 26;
SignalPeriod = 9;

macd_a = MACD(FastPeriod, SlowPeriod);
signal_a = Signal(FastPeriod, SlowPeriod, SignalPeriod);
 

Similar threads