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
Unexpectly, I find out the problem by amending the line from
ma[i] = iMAOnArray(length,0,range,0,MODE_SMA,i);
to
ma[i] = iMAOnArray(length,0,1,0,MODE_SMA,i);
and the result is now correct!
However, why can't I use extern int in this indicator???
Where did you set length to be a series array (zero being the newest?)
I wonder if anyone has ever found that an indicator buffer is not automatically set as series?
I know that the documentation states that buffers are non-series by default, but that is not the case.
I wonder if anyone has ever found that an indicator buffer is not automatically set as series?
I know that the documentation states that buffers are non-series by default, but that is not the case.
....
However, why can't I use extern int in this indicator???
This morning I wasted one hour with a - may be - similar issue. But in my case, I was the problem.
I've coded a very simple indicator while it stayed in use in the chart of MT4. While doing that, I changed the default-Value of a indicator-variable but forgot to change it in the chart. So the indicator was still working with a very different and earlier value than I have expected through my code. It was to easy to look at the value debbuging. Because I've read your topic before, I thought mine is the same story.
So, long story short: Is it possible that you are testing with an old and wrong value in your 'range' ?