Download MetaTrader 5

ObjectDelete

The function removes the object with the specified name from the specified chart.

bool  ObjectDelete(
   long    chart_id,     // chart identifier
   string  name          // object name
   );

Parameters

chart_id

[in]  Chart identifier. 0 means the current chart.

name

[in]  Name of object to be deleted.

Return Value

Returns true if the removal was successful, otherwise returns false. To read more about the error call GetLastError().

Note

When an object is renamed, two events are formed simultaneously. These events can be handled in an Expert Advisor or indicator by the OnChartEvent() function:

  • an event of deletion of an object with the old name;
  • an event of creation of an object with a new name.

Updated: 2015.12.03