DeleteByName

Author: ����� �����
DeleteByName
0 Views
0 Downloads
0 Favorites
DeleteByName
//+------------------------------------------------------------------+
//|                                              DeleteByPreName.mq4 |
//|                                                      Äåíèñ Îðëîâ |
//|                                    http://denis-or-love.narod.ru |
//|Clears the chart of all objects with the name beginning on the specified prefix
//|Äëÿ áûñòðîé î÷èñòêè ãðàôèêà îò îáúåêòîâ ïî íà÷àëó èõ èìåíè        |
//+------------------------------------------------------------------+
#property copyright "Äåíèñ Îðëîâ"
#property link      "http://denis-or-love.narod.ru"


#property show_inputs

extern string PreName ="íàïå÷àòàéòå ïðåôèêñ";
//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {
//----
   for(int k=ObjectsTotal()-1; k>=0; k--)  // Ïî êîëè÷åñòâó âñåõ îáúåêòîâ 
     {
      string Obj_Name=ObjectName(k);   // Çàïðàøèâàåì èìÿ îáúåêòà
      string Head=StringSubstr(Obj_Name,0,StringLen(PreName));// Èçâëåêàåì ïåðâûå ñèì

      if (Head==PreName)// Íàéäåí îáúåêò, ..
         {
         ObjectDelete(Obj_Name);
         //Alert(Head+";"+Prefix);
         }                  
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---