I having problem with this function and are getting mad...
According to the documentation it reads the array from left to right and if I choose 0 it has to start from 0?
Example:
value=iMAOnArray(Close_Buffer,0,15,0,MODE_EMA,0);
I "fed" the Close_Buffer with the latest value (latest is 0 in array) and the array contains about 50 values/element.
I saw that I could invert the array with the "ArraySetAsSeries" instruction, or do I allways need to run this instruction before I "iMAOnArray"?
What happens if the array contains 50 elements but:
value=iMAOnArray(Close_Buffer,0,15,0,MODE_EMA,0);
Here i want 15 periods of MA. Do I have shift like:
value=iMAOnArray(Close_Buffer,15,15,0,MODE_EMA,0);
To use only the 15 first values?
I read on the forum and there were several people struggle with this function...
I read on the forum and there were several people struggle with this function...
What happens if the array contains 50 elements but:
value=iMAOnArray(Close_Buffer,0,15,0,MODE_EMA,0);
Here i want 15 periods of MA. Do I have shift like:
value=iMAOnArray(Close_Buffer,15,15,0,MODE_EMA,0);
To use only the 15 first values?
I read on the forum and there were several people struggle with this function...
I struggled with this function too, to make it work with limited chart history is difficult. I never did figure out how to use that second parameter in iMAOnArray() in a way that worked correctly. The problems begin if there are any empty indexes in the array to be used with iMAOnArray(). Empty array indexes are asigned EMPTY_VALUE which does some crazy things to the results of averaging algorithms such as EMA or LWMA

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I having problem with this function and are getting mad...
According to the documentation it reads the array from left to right and if I choose 0 it has to start from 0?
Example:
value=iMAOnArray(Close_Buffer,0,15,0,MODE_EMA,0);
I "fed" the Close_Buffer with the latest value (latest is 0 in array) and the array contains about 50 values/element.
I saw that I could invert the array with the "ArraySetAsSeries" instruction, or do I allways need to run this instruction before I "iMAOnArray"?