Errors, bugs, questions - page 929

 
The function returns the window number. You are not checking the result correctly.
 
Konstantin83:
How does the ObjectFind function work? Where is the error in the code for finding an object by name? The object's properties change, but I can't find the object itself.

void OnStart()
  {
//---

   if(ObjectCreate(0,"test",OBJ_LABEL,0,0,0))
     {
      ObjectSetString(0,"test",OBJPROP_TEXT,"Init");
      if(ObjectFind(0,"test")<0)
        {
         ObjectSetString(0,"test",OBJPROP_TEXT,"Нашел объект с помощью функции ObjectFind");
        }
      else
        {
         ObjectSetString(0,"test",OBJPROP_TEXT,"Не нашел объект с помощью функции ObjectFind");
        }
     }
  }

We should change the condition:

if(ObjectFind(0,"test")>=0)
 
Contender:

We should change the condition:

Thank you :)

I've got a bit of a kink in me.

 
Konstantin83:

Thanks :)

Something's got me all twisted up.

It happens :)
 

Colleagues, please advise on aligning text on a chart.

The chart needs to display some text information. For example, like this:

Example output

As you can see from the example, the text is formatted as follows:

1. The name of the parameter is aligned from left to right, with the same beginning from the left edge.

2. The parameter values are aligned from right to left, with the same beginning at the right edge.

The example I gave above uses the Comment() function. To visualise the example, I've used space-adjusted text.

Actually, my question is. What is the best way (what functions) to implement this mechanism of automatic alignment with minimal performance loss?

I would appreciate both a general answer and some code.

 

Maybe someone would be interested. In general, the problem is partially solved by using theOBJ_LABEL graphical object and using a monospaced font.

I create objects in OnInit() and delete them in OnDeinit() and try to set OBJPROP_TEXT property. If there is an error, just report it in the form of a log. Checking on every tick/timer to see if a user/another EA has deleted the label is too resource intensive.

What it didn't manage to solve is to get the width of the set mark. To, roughly speaking, depending on the_value, remove its upper right corner farther away, so that it doesn't overlap with the_value's name. Simply find a comfortable distance to fit a seven-digit value. Eight-digit will overlap. Not nice and not practical! :)

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов - Документация по MQL5
 
voix_kas:

Maybe someone would be interested. In general, the problem is partly solved by using theOBJ_LABEL graphical object and using a monospaced font.

Use OBJ_EDIT ("Entry field") with no editing allowed, it can be sized, colour, font and text alignment withOBJPROP_ALIGN.

One for the name withALIGN_LEFT and one for the value withALIGN_RIGHT.

To prevent another program from deleting your objects give them unique names.

The objects created from the program cannot be selected and deleted by the user initially, but if they do, it is easy to trace this fact and recreate the object.

 

There are glitches in the signals:
Deposits: 1.68 USD############ Broker: Alpari-Demo
WHO deposited ??? who is playing ???

 
Is it possible to make it so that during optimisation all calculations go only to the cloud? I would like to unload all processor cores on my computer, as one agent won't shut down.
 
paladin800:
Is it possible to make it so that during optimisation all calculations go only to the cloud? I would like to disconnect all CPU cores on my computer from the load, as one agent is not disconnected.
Right-click in the Agents section and uncheck Local agents in the context menu.
Reason: