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

 
Ilyas #:

Thank you, corrected.

Can't check because:

Compilation error.

It's crashing.

 

Forum on trading, automated trading systems and trading strategy testing

CHARTEVENT_CHART_CHANGE in MQL5

Ilyas, 2021.12.08 11:02

The vast majority of properties of a chart (the chart on which the Expert Advisor works) are requested bypassing the Expert Advisor message queue

Below is a list of properties, which in any case are requested via queue:

  • CHART_WINDOW_IS_VISIBLE
  • CHART_HEIGHT_IN_PIXELS
  • CHART_WINDOW_TOP
  • CHART_FIRST_VISIBLE_BAR
  • CHART_PRICE_MIN (providing a non-zero subwindow is specified)
  • CHART_PRICE_MAX (if non-zero subwindow is specified)

 
 

Forum on trading, automated trading systems and trading strategy testing

Bugs, bugs, questions

Nikolai Semko, 2021.12.26 11:17

What have I found out:

  • resource is not deleted when switching windows
  • when switching windows, the CHARTEVENT_CHART_CHANGE event occurs, as the window size changes to the size of the previous "not all windows", i.e. as if the window was switched to this mode:
  • it is reasonable to monitor the window activity (ChartGetInteger(0, CHART_BRING_TO_TOP)) and turn off the bitmap generation (fill the canvas) to save CPU resources if the window is inactive


In the test indicator, the counter is saved in the kanvas resource.


 
Nikolai Semko #:
  • it is useful to monitor window activity (ChartGetInteger(0, CHART_BRING_TO_TOP)) and turn bitmap generation off (fill canvas) to save CPU resources if the window is inactive

It is far from useful, in fact this property indicates that the window is in focus (or more precisely selected). For example, if the windows are tiled and the window is out of focus, then in your case the rendering of that window will stop.

 
Yury Kulikov #:

Far from useful, in fact this property indicates that the window is in focus (or rather selected). For example, if the windows are tiled and the window is not in focus, then in your case the rendering of that window will stop.

Oh, right.
And as far as I understand - there is no way to find out if some window is expanded to the whole window?
 
Nikolai Semko #:
Ah, there is.
And as far as I understand - there is no way to find out if any window is deployed for the whole window?
There is. Look in the properties. I'm not comfortable on a mobile. There's something in there with the maximized
 
Artyom Trishkin #:
There is one. Look in the properties. It's not convenient for me from my mobile phone.
So, Artem, are you saying that there is a way to find out if the window is visible?
Spent some time on it, but never found a solution
 
Nikolai Semko #:
So Artem, are you saying that there is a way to find out if the window is visible?
Spent some time on it, but still haven't found a solution

CHART_IS_MAXIMIZED

Chart window unfolded.

bool r/o

CHART_IS_MINIMIZED

Chart_is_minimized chart window is minimized

bool r/o

Документация по MQL5: Константы, перечисления и структуры / Константы графиков / Примеры работы с графиком
Документация по MQL5: Константы, перечисления и структуры / Константы графиков / Примеры работы с графиком
  • www.mql5.com
Примеры работы с графиком - Константы графиков - Константы, перечисления и структуры - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Nikolai Semko #:
is there a way to find out if a window is visible?

Here.

Reason: