ToClearChartObjectsByType - MetaTrader 5 Script - MT4/MT5 Resources
The script removes from the current chart all objects of the type selected by the trader in the input parameters.
//+--------------------------------------------------------+ //| Script input parameters | //+--------------------------------------------------------+ Input ENUM_OBJECT object type = - 1 ; //Object type to be deleted
When used with the default parameters, the script will remove all objects from the current chart.
If you frequently need to delete objects of a fixed type, you should script a copy of the object with the appropriate type ID specified as an input variable. For example, here is a script for removing trend lines by clearing the chart object via OBJ_TREND :
Attachment download
📎 toclearchartobjectsbytype.mq5 (2.72 KB)
📎 toclearchartobjectsbyobj_trend.mq5 (2.7 KB)
Source: MQL5 #17996
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •