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

Automated Trading Language Documentation

MTF Average True RangeMTF Average True Range Try product
MTF Average True Range
Author: VincentX
Simple Trading Systems Using Semaphore Indicators Simple Trading Systems Using Semaphore Indicators Screenshot
EURCHF, M5
Real
Price on Bollinger Channel Indicator
Price on Bollinger Channel
Author: Snail000
Subscribe to signal
A Forex invest
234.23%, 16 732.46 USD

Add

Adds an element to the end of the array.

bool  Add(
   long  element      // Element to add
   )

Parameters

element

[in]  Value of the element to add to the array.

Return Value

true if successful, false - if you can not add an element.

Example:

//--- example for CArrayLong::Add(long)
#include <Arrays\ArrayLong.mqh>
//---
void OnStart()
  {
   CArrayLong *array=new CArrayLong;
   //---
   if(array==NULL)
     {
      printf("Object create error");
      return;
     }
   //--- add arrays elements
   for(int i=0;i<100;i++)
     {
      if(!array.Add(i))
        {
         printf("Element addition error");
         delete array;
         return;
        }
     }
   //--- use array
   //--- . . .
   //--- delete array
   delete array;
  }


Updated: 2010.02.09