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

Automated Trading Language Documentation

ChannelAnt Indicator
ChannelAnt
Author: GODZILLA
Screenshot
EURJPYm, H4
Real
Tracing, Debugging and Structural Analysis of Source Code Tracing, Debugging and Structural Analysis of Source Code Subscribe to signal
Live Forex Deals for all Majors Pairs
26.50%, 12 558.15 USD
BBTraderBBTrader Try product
BBTrader
Author: pitaking

SearchLast

Finds the last element equal to the model in sorted array.

int  SearchLast(
   string  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 CArrayString:: SearchLast(string)
#include <Arrays\ArrayString.mqh>
//---
void OnStart()
  {
   CArrayString *array=new CArrayString;
   //---
   if(array==NULL)
     {
      printf("Object create error");
      return;
     }
   //--- add arrays elements
   //--- . . .
   //--- sort array
   array.Sort();
   //--- search element
   if(array.SearchLast("ABC")!=-1) printf("Element found");
   else                            printf("Element not found");
   //--- delete array
   delete array;
  }


Updated: 2010.02.22