0
Views
0
Downloads
0
Favorites
DeleteAllObjects
//+------------------------------------------------------------------+
//| DeleteAllObjects.mq4 |
//| Copyright 2014, ForexTradingAutomation.com |
//| http://ForexTradingAutomation.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, ForexTradingAutomation.com"
#property link "http://ForexTradingAutomation.com"
#property version "1.00"
#property strict
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//---
long currChart;
long prevChart=ChartFirst();
int deleted = ObjectsDeleteAll(prevChart);
int chartCount = 1;
// Loop through charts
while(true)
{
// Get next chart
currChart=ChartNext(prevChart);
// If currChart < 0 ==> we iterated through all charts, exit loop
if(currChart<0)
break;
deleted += ObjectsDeleteAll(currChart);
chartCount++;
prevChart=currChart;
}
PrintFormat("Deleted %d objects on %d charts", deleted, chartCount);
}
//+------------------------------------------------------------------+
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---