iMAOnArray

 

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"?

 
IntraTrade:

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...

 
IntraTrade:


I read on the forum and there were several people struggle with this function...

Me too . . the documentation is less than crystal clear . . . I gave up and did my own thing . .
 
IntraTrade:


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

Reason: