[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 20

 
Prix:
Good afternoon. If anyone knows where you can download a ZIGZAG indicator that marks the point at which a new beam appears (e.g. in a different colour). If there is one at all...

Look for DT_ZZ_Nen
 
Vinin:

Look for DT_ZZ_Nen

Thanks, I'll try it now.
 
Help me deal with arrays passed to iMAOnArray function.
For some reason, this function works only with buffer array (in VMA example)
and won't work with "regular" (SMA, for example).

Below is an outline of how I do it in my programs. What's wrong?

double MA1[],MA2[],VMA[],SMA[];

int init()
{

   SetIndexBuffer(0,MA1);
   SetIndexBuffer(1,MA2);
   SetIndexBuffer(2,VMA);
   SetIndexEmptyValue(0,0.0);
   SetIndexEmptyValue(1,0.0);
   SetIndexEmptyValue(2,0.0);  
   ArrayResize(SMA,1);  
   ArrayInitialize(SMA,0);

 return(0);
}

int start() 
{  
 
SMA[i]=...........;
VMA[i]=...........;

MA1[i]=iMAOnArray(SMA,0,8,0,0,0); //----этот вариант НЕ работает
MA2[i]=iMAOnArray(VMA,0,8,0,0,0); //----этот вариант всегда работает  
   
  return(0);
}

 

I've already written to you about this, but you chose to ignore it:

When declaring an array, which is not an indicator buffer, you MUST specify its size, preferably larger, so that the interpreter allocates memory space.

 
Vinin:

Look for DT_ZZ_Nen

If I understand correctly, the point shows not when the new ray appears, but the maximum or minimum of the candle on which it appeared... But not bad either... thanks...
 
Fox_RM:
Help me deal with arrays passed to iMAOnArray function.
For some reason, this function works only with buffer array (in VMA example)
and won't work with "regular" (SMA, for example).

Below is an outline of how I do it in my programs. What's wrong?

The sequence of preparation of SMA[] and VMA[] arrays is not clear from this code fragment, assuming that you declared the size of a "non-buffer" array.

These arrays must be filled with data first, and then arrays MA1[] and MA2[] must be created using iMAOnArray().

 
FAQ:

I've already written to you about this, but you chose to ignore it:

When declaring an array, which is not an indicator buffer, you MUST specify its size, preferably larger, so that the interpreter allocates memory space.

I've given it a size from 1 to Bars. Both during declaration and ArrayResize, nothing changed;(
 
double SMA[];

int init()
{
   ArrayResize(SMA,1);     //--- Размер различный задавал от 1 до Bars 
   ArrayInitialize(SMA,0);

 return(0);
}

int start() 
{  
 
SMA[i]=...........; // --- Заполнение массива.

MA1[i]=iMAOnArray(SMA,0,8,0,0,0); //----MA1 буферный.
   
  return(0);
}

I usually do this with a non-buffered one.

 
double MA1[],MA2[],VMA[],SMA[3000];<= вписать размер!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
FAQ:

I see what you mean.) I've given it a size from 1 to Bars. Both at AD and ArrayResize. Maybe the error is in something else?