MQL4 - automated forex trading   /  

Documentation

MQL4 Reference  Object functions  ObjectsTotal

 
Use the opportunities of
MQL5 in MetaTrader 5
Study the new MQL5 language
Study the new MQL5 language.
Reference is already available
int ObjectsTotal( int type=EMPTY)
Returns total amount of objects of the specified type in the chart.
Parameters:
type   -   Optional parameter. An object type to be counted. It can be any of the Object type enumeration values or EMPTY constant to count all objects with any types.
Sample:
  int    obj_total=ObjectsTotal();
  string name;
  for(int i=0;i<obj_total;i++)
    {
     name=ObjectName(i);
     Print(i,"Object name for object #",i," is " + name);
    }