MQL4 - automated forex trading   /  

Documentation

MQL4 Reference  Custom indicators  SetIndexBuffer

 
bool SetIndexBuffer( int index, double array[])
Binds the array variable declared at a global level to the custom indicator pre-defined buffer. The amount of buffers needed to calculate the indicator is set with the IndicatorBuffers() function and cannot exceed 8. If it succeeds, TRUE will be returned, otherwise, it will be FALSE. To get the extended information about the error, one has to call the GetLastError() function.
Parameters:
index   -   Line index. Must lie between 0 and 7.
array[]   -   Array that stores calculated indicator values.
Sample:
  double ExtBufferSilver[];
  int init()
    {
      SetIndexBuffer(0, ExtBufferSilver); // first line buffer
      // ...
    }