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

Automated Trading Language Documentation

Soldiers CrowsSoldiers Crows Try product
Soldiers Crows
Author: Alextp
Subscribe to signal
ForexHacked 15
29.77%, 4 992.10 USD
XMA_Range_Bands Indicator
XMA_Range_Bands
Author: GODZILLA
Screenshot
EURUSD, H1
Demo
Creating Multi-Colored Indicators in MQL5 Creating Multi-Colored Indicators in MQL5

SearchGreatOrEqual

Searches for an element greater than or equal to the sample in the sorted array.

int  SearchGreatOrEqual(
   CObject*  element      // Sample
   ) const

Parameters

element

[in] The sample element to search in the array.

Return Value

The position of the found element, if successful, -1 - if the item was not found.

Example:

//--- example for CArrayObj::SearchGreatOrEqual(CObject*)
#include <Arrays\ArrayObj.mqh>
//---
void OnStart()
  {
   CArrayObj *array=new CArrayObj;
   //---
   if(array==NULL)
     {
      printf("Object create error");
      return;
     }
   //--- add arrays elements
   //--- . . .
   //--- sort array
   array.Sort();
   //--- create sample
   CObject *sample=new CObject;
   if(sample==NULL)
     {
      printf("Sample create error");
      delete array;
      return;
     }
   //--- set sample attributes
   //--- . . .
   //--- search element
   if(array.SearchGreatOrEqual(sample)!=-1) printf("Element found");
   else                                     printf("Element not found");
   //--- delete array
   delete array;
  }


Updated: 2010.02.22