MQL4 - automated forex trading   /  

Documentation

MQL4 Reference  Array functions  ArrayInitialize

 
Use the opportunities of
MQL5 in MetaTrader 5
Study the new MQL5 language
Study the new MQL5 language.
Reference is already available
int ArrayInitialize( void array[], double value)
Sets all elements of a numeric array to the same value. Returns the count of initialized elements.
Note: It is not recommended to initialize index buffers in the custom indicator init() function as such functions are initialized automatically with an "empty value" at allocation and re-allocation of buffers.
Parameters:
array[]   -   Numeric array to be initialized.
value   -   New value to be set.
Sample:
  //---- initializing of all array elements with 2.1
  double myarray[10];
  ArrayInitialize(myarray,2.1);