no one can help me ?

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,
I need help in order to translate a function MMA in mql 4. I'm sure it's easy but I have some problem to resolve :
function MMA;
input s(series), period(number);
result res(series);
vars i(number), tmp(number), l(number), cnt(number), f(number);
begin
f := front(s);
l := f + period - 1;
cnt := back(s);
if l <= cnt then begin
tmp := 0;
for i := f to l do
tmp := tmp + s[i];
res[l] := tmp / period;
for i := l + 1 to cnt do
res[i] := res[i - 1] + (s[i] - res[i - 1]) / period;
end;
end.
Thanks