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

Automated Trading Language Documentation

AIIV USDCAD Active Index Inflection Values USDCADAIIV USDCAD Active Index Inflection Values USDCAD Try product
AIIV USDCAD Active Index Inflection Values USDCAD
Author: Aktiniy
Subscribe to signal
HighProfit2
177.95%, 27 795.00 USD
ATC Champions League: Interview with Boris Odintsov (ATC 2011) ATC Champions League: Interview with Boris Odintsov (ATC... Positions Change  Informer Expert Advisor
Positions Change Informer
Author: Rone
Screenshot
XAUUSD, D1
Real

InsertSort

Inserts element in a sorted array.

bool  InsertSort(
   string  element      // Element to insert
   )

Parameters

element

[in] value of the element to be inserted into a sorted array

Return Value

true if successful, false - if you can not insert the element.

Example:

//--- example for CArrayString::InsertSort(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();
   //--- insert element
   if(!array.InsertSort("ABC"))
     {
      printf("Insert error");
      delete array;
      return;
     }
   //--- delete array
   delete array;
  }


Updated: 2010.02.09