MQL4 Reference
Object functions
ObjectsTotal
| 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);
}
|
|
|