Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1488

 
In other words: call Comment only if the string passed to it has changed
 
Sergey Gridnev #:
If the information has not changed, do not call Comment

Information changes periodically.
For example, I want to see the position with the lowest opening price. Or to know the tick of the last closed position.
You can write everything in the print, but it is not convenient to look, you can miss. And so I can see where I have errors at once.

 
Maksim Burov #:

Googled it...
Cool type) where does he fit in with my problems))))))

On the forum find the thread "canvas is cool" or Latin spelt but I remember.

 
Maksim Burov #:

Googled it...
Cool type) where does he fit in with my problems))))))

Canvas - это круто! - Попробуйте продемонстрировать возможности пользовательской графики через класс CCanvas.
Canvas - это круто! - Попробуйте продемонстрировать возможности пользовательской графики через класс CCanvas.
  • 2018.02.16
  • www.mql5.com
коротким кодом эффектно продемонстрировать возможности пользовательской графики через класс CCanvas. По сути из класса CCanvas я использую только массив точек графического ресурса m. Просто класс CCanvas берет на себя некоторую рутину при создании ресурса
 
Artyom Trishkin #:

Thank you. Read the thread, watched the video. It's pretty cool. But to me to this, as ... far)
I have everything more prosaic, why it starts to slow down, how to fix, and what affects).

 
Maksim Burov #:

Thank you. Read the thread, watched the video. It's pretty cool. But to me to this, as ... far)
I have everything more prosaic, why it starts to slow down, how to fix, and what affects).

Comment at each tick redraws the chart. Hence the brakes.

Do it on canvas. There you need to update only the kanvas. It is practically not necessary to redraw the chart.

 
Artyom Trishkin #:

Comment redraws the chart on every tick. Hence the brakes.

Do it on kanvas. There you need to update only the kanvas. It is practically not necessary to redraw the chart.

Thank you.
Do you have any examples?
 
Maksim Burov OBJ_BITMAP_LABEL and resources.

It is certainly not cartoons using iCanvas Nikolai Semko but better than using simple OBJ_LABELs

 
Alexey Viktorov #:

Take a look at this indicator


🙏
 
Maksim Burov Comment in the EA code?
What options are there to fix this?
Does it affect the speed of optimisation?

You don't have to use kanvas.

For comment not to slow down the tester with visualisation, it is necessary that comment is not called more often than 30 milliseconds.

For example like this:

   static uint lastCalc= 0 ;
   uint cur= GetTickCount();
   if (cur-lastCalc> 30 ) {
      Comment("blablabla");
      lastCalc=cur; 
   }
Or use Print instead of Comment if it is important not to skip values.

If better visualisation of the output of any values is important, then kanvas is better.

https://www.mql5.com/ru/forum/277867/page8#comment_19186284
Reason: