[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 1108

 

Good evening everyone!!!

I'm in a panic, I create 10 OBJ_TEXT type objects on the chart, then run a loop to delete them by name tag.

So the function

int Obektov = ObjectsTotal(OBJ_TEXT);

shows that there are indeed 10, but when I start analyzing their names to delete (by name, all 10 are to be deleted) with this code

int Obektov = ObjectsTotal(OBJ_TEXT);
       Alert(Obektov);
       for(int j = 0; j < Obektov; j++)
         {
          Alert("Анализ ", j, "  ", ObjectName(j));
          ObjectName(j)
          if(StringFind(ObjectName(j), "Skalomer_", 0) == 0)
            {
             Alert("Удяляем ", j, "   ", ObjectName(j));
             ObjectDelete(ObjectName(j));
            }
         }
      }

I see that

ObjectName(j)

Reads the names only part of the objects, and the rest DOES NOT SEE and gives the error ERR_OBJECT_DOES_NOT_EXIST 4202 The object does not exist BUT I SEE THEM WITH MY EYES - THEY ARE 8-))!

 

This is what the printout draws

If you run the cycle again, it will see some of the remaining objects and remove them too (it will see 5 remaining objects)

And on the third time it will delete all the objects. It feels like objects are being removed one by one.

 
ALEX_SPB_RU:

This is what the printout draws

If you run the cycle again, it will see some of the remaining objects and remove them too (it will see 5 remaining objects)

And on the third time it will delete all the objects. It feels like objects are being deleted one by one.

https://www.mql5.com/ru/forum/123941

I was told to use this code

// удаление по маске всех объектов индюка
   for (int i = ObjectsTotal() - 1; i >= 0; i--)
    {
      string name = ObjectName(i);
      if (StringFind(name, "sig_nal") == 0)
      {
         ObjectDelete(name);
      }
    }
//----

and for different names I used

// удаление по маске всех объектов индюка
   for (int i = ObjectsTotal() - 1; i >= 0; i--)
   {
      string name = ObjectName(i);
      if (StringFind(name, "signal") == 0)
      {
         ObjectDelete(name);
      }
      else if (StringFind(name, "Asignal") == 0)
      {
         ObjectDelete(name);
      }
   }
//----
 
ALEX_SPB_RU:

Good evening everyone!!!

I'm in a panic, I create 10 OBJ_TEXT type objects on the chart, then run a loop to delete them by name tag.

So the function

shows that there are indeed 10, but when I start analyzing their names for deletion (by name all 10 are to be deleted) with this code

int Obektov = ObjectsTotal(OBJ_TEXT);
       Alert(Obektov);
       for(int j = 0; j < Obektov; j++)
         {
          Alert("Анализ ", j, "  ", ObjectName(j));
          ObjectName(j)
          if(StringFind(ObjectName(j), "Skalomer_", 0) == 0)
            {
             Alert("Удяляем ", j, "   ", ObjectName(j));
             ObjectDelete(ObjectName(j));
            }
         }
      }

I see that

Reads the names only part of the objects, and the rest DOES NOT SEE and gives the error ERR_OBJECT_DOES_NOT_EXIST 4202 The object does not exist BUT I SEE THEM WITH MY EYES - THEY ARE 8-))!

Delete (objects) in reverse order (from a larger number to a smaller number), as the numbering is changed after deletion ..... This has been discussed hundreds of times.
 

Good evening everyone!

How do I calculate the Stop Loss? Calculation formula.

 
Sergey_Rogozin:

Good evening everyone!

How do I calculate the Stop Loss? Calculation formula.

Divide the time by the price and multiply by the number of currencies.

 
Danil93:
If you can call reading a reference book lazy, then lazy, I just want to know what to read and then maybe I can do it myself. I just know that if someone is good at something, it's very easy and quick to help...

I gave you the names of the functions.

I even showed you the algorithm.

are you too lazy to even think about what you've written?

 
Can you tell me what this message means when compiling the EA:

Function "openPositionsBUYreal" is not referenced and will be removed from exp-file

Function "openPositionsSELLreal" is not referenced and will be removed from exp-file

0 errors, 2 warnings

At the beginning of the EA is:
#include <stdlib.mqh>


Is it a file reference in libraries? And will the EA work correctly with this reference and 2 warnings during compilation?
 
Danil93:
If you can call it laziness to read the weight of the guide, then laziness, I would like to read something specifically, and then maybe I can do it myself. I just know that if someone has a good understanding of something, it's very easy and quick to help...

but i know from experience that if someone is too lazy to understand their own problem, it's a bummer to help...
 
kolyango:
Tell me, what does it mean when compiling the EA: At the beginning of the EA there is: Is it a file reference in libraries? And will the EA work correctly with this reference and 2 warnings when compiling?

It depends on where these functions are located.
Where are they stored in your code?
And you use them in your EA. They are just not used, so the compiler warns you that it will exclude them. This is normal.
Reason: