Features of the mql5 language, subtleties and tricks - page 219

 
fxsaber #:

Here.

Alexey Viktorov#:

CHART_IS_MAXIMIZED

Chart_is_maximized

bool r/o

CHART_IS_MINIMIZED

Chart_is_minimized chart is minimized

bool r/o

Thank you, I will try it now.
Also found CHART_WINDOW_IS_VISIBLE. But I think I've checked it before and there were some nuances.

 
Nikolai Semko #:

Thanks, I'll experiment now.
Also found CHART_WINDOW_IS_VISIBLE. But I think I checked it before and there were some nuances.

fxsaber #:

Here.

Yes, your variant works, unlike CHART_WINDOW_IS_VISIBLE.
Thanks again.

So it makes sense to control chart visibility for bitmap formation this way instead of through CHART_BRING_TO_TOP

Except that control is too expensive without using user32.dll, because you have to constantly monitor all windows.
But obviously, all windows should be monitored only when the own chart window is not in focus (ChartGetInteger(0, CHART_BRING_TO_TOP) == false)
 
Nikolai Semko #:

But obviously, all windows should be monitored only when the own chart window is not in focus(ChartGetInteger(0, CHART_BRING_TO_TOP) == false)

A minimized window can return true even when there are multiple windows.

 
fxsaber #:

A minimised window can return true even when there is more than one window.

Are we talking about CHART_BRING_TO_TOP or IsInvisible function?

 
Nikolai Semko #:


So it makes sense to control chart visibility for bitmap formation this way instead of through CHART_BRING_TO_TOP

HHH except that monitoring is too expensive without using user32.dll, because you need to constantly monitor all the windows.
But it's obvious that monitoring all the windows should be done only when your own chart window is out of focus (ChartGetInteger(0, CHART_BRING_TO_TOP) == false)

Yes, it can be justified only in Expert Advisors, because ChartGet functions run much faster there.
There is no sense to bother with it in indicators. It's quicker to redraw the canvas than to monitor the status of other windows.
IMHO

Again it all comes down to sluggishness of ChatGet functions :(
 
Nikolai Semko #:

Are we talking about CHART_BRING_TO_TOP or IsInvisible?

CHART_BRING_TO_TOP.

 
Nikolai Semko #:

Yes, this can only be justified in EAs, as their ChartGet functions are much faster.

It was slow when I monitored it.

There is no sense to bother with indicators. It's faster to redraw canvas than monitor other windows.
IMHO

Depends on the severity of the calculations. For HFT it is very important to keep visualization as minimal as possible. That's why I use IsInvisible2.

 
fxsaber #:

CHART_BRING_TO_TOP.

It is strange that in this mode the size of the window appears as if it is not minimised.
However, this is a very rare case where the active window is minimized. Yes, in this case it will flail around for no good reason.

 
Nikolai Semko #:

However, this is a very rare case where the active window is minimised.

Forum on trading, automated trading systems and strategy testing

MT5 and Speed in Action

fxsaber, 2020.09.30 21:42

I see that even my now performance-lined bots are running so that the Terminal CPU is 15%. And now a tip of the hat!

  • Close Market Watch (CTRL+M) - only traded symbols in it.
  • Close table with current positions (CTRL+T).
  • Minimize all charts.

Voila, terminal CPU 2.5%! Unload your VPS. If anyone else has any valid recommendations, let me know.


Dear developers, please have the ability to switch the terminal to the minimum resource consumption mode for algotrading.

The most widespread mode of operation of battle advisors.
 
fxsaber #:
The most common mode of operation for combat EAs.

means that in combat mode you should turn off all graphical nonsense without minimisation. Let the graphics be frozen if the window remains visible but not active.
And it is easier and better, it seems to me, to automatically turn off and remove all graphics when the mouse is inactive, for example 1 minute. As soon as the mouse is active - the graphics resumes.