In A buffer3 is a buffer, it is asSeries. Therefor iMA(5) knows you mean (5 + 6 + 7...)/n.
In B buffer3 is an array, not asSeries. Therefor iMA(5) wants ( 5 + 4 + 3...)/n which doesn't work.
Set the array to series, before populating it.
ArraySetAsSeries - Array Functions - MQL4 Reference
Thank you very much, it work now

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
hello, can anyone know why these two indicators show different result?
Indi_A.mq4 is original code
Indi_B.mq4 is my changed code
I want Indi_B show as Indi_A's result