MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal

Automated Trading Language Documentation

i-AnyRange2 Indicator
i-AnyRange2
Author: GODZILLA
Freak JuniorFreak Junior Try product
Freak Junior
Author: johnnypasado
Screenshot
GBPUSD.s, M30
Real
Subscribe to signal
Carousel FX
22.90%, 137.21 USD
MetaTrader 5 and MATLAB Interaction MetaTrader 5 and MATLAB Interaction

Reserve

Allocates memory to increase the size of the array.

bool  Reserve(
   int  size      // Number
   )

Parameters

size

[in] The number of additional elements of the array.

Return Value

true if successful, false - if there was an attempt to seek the amount is less than or equal to zero, or if the array did not increase.

Note

To reduce memory fragmentation, increase the size of the array is made with a step previously given through the method of Step (int), or 16 (default).

Example:

//--- example for CArrayString::Reserve(int)
#include <Arrays\ArrayString.mqh>
//---
void OnStart()
  {
   CArrayString *array=new CArrayString;
   //---
   if(array==NULL)
     {
      printf("Object create error");
      return;
     }
   //--- reserve memory
   if(!array.Reserve(1024))
     {
      printf("Reserve error");
      delete array;
      return;
     }
   //--- use array
   //--- . . .
   //--- delete array
   delete array;
  }


Updated: 2010.02.09