I know this is AFL 101 but I'm a bit confused on it. Let's say I wanted to Buy today if the Close of three days ago was higher than its "center line" moving average. I know I have to shift the Close array, but do I also have to shift the MA array to make this comparison? My thought is yes.
So of the two formulas below, Formula B should be the correct one. Or is it? Does AFL automatically shift built-in function arrays when making comparisons? In that case, Formula A would be correct. Formula A CenterLine = MA(C, 5); Close3 = Ref(Close, -3); Buy = Close3 > CenterLine Formula B CenterLine = MA(C, 5); CenterLine3 = Ref(CenterLine, -3); Close3 = Ref(Close, -3); Buy = Close3 > CenterLine3
