Yes, you're probably right. This is likely to be the case. And to save resources, it would be good to monitor window activity and not generate a bitmap if the window is not active.
It's worth checking rather than making assumptions.
What we have found out:
resource is not deleted when switching windows
when switching windows, the CHARTEVENT_CHART_CHANGE event occurs because the window size is changed to the size of the previous "not all window" setting, i.e. it is 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.
the CHARTEVENT_CHART_CHANGE event occurs when switching windows, because the window is resized 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.
so this is your obvious mistake - using the same resource on many charts in many indicators. your indicators (or EA) do not work if the window is not active - i.e. the user cannot use multiple copies simultaneously on different charts.
Taras Slobodyanik #: so it's obvious your mistake - use the same resource in many charts in many indicators. your indicators (or EA) don't work if the window is not active - i.e. the user can't use several copies of them simultaneously in different charts.
What is this nonsense, Taras?
I don't even know how to answer.
Study the math.
What does it have to do with indicator performance and graphical output? Each indicator or EA has its own graphical resource.
Look at CCanvas class, how resource name is formed.
What does this have to do with indicator performance and graphical output? Each indicator or EA has its own graphical resource.
Look at CCanvas class, how resource name is formed.
And when resources are the same, they are redrawn for all copies.
Checked your code in "windowed" mode and on the same chart - the size is the same. For "expanded" mode, the size changes, but it's an ancient bug, it is several years old.
What does the operation of the indicator and graphical output have to do with it?
i mean that if the window is inactive and you recommend not to refresh the canvas - it means that
ps. and consequently - panels will not work thanks to your advice :)
i.e. visually in "windowed" mode, indicators (and EA) will not update.
ps. However, if the check only in OnChartEvent, it should work, I need to check.
the CHARTEVENT_CHART_CHANGE event occurs when switching windows, because the window is resized to the size of the previous "not all windows", i.e. as if the window went 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.
Perfect. Now you can tell exactly how things work, rather than guessing. Will be useful to anyone working with CCanvas.
You are probably in beta. Thought this feature was gone in beta version. But I checked my own (build 3091, release version) and it doesn't work either.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Ah, doesn't this theme in the debug work anymore?
Too bad :(( It was very useful in my work
Yes, you're probably right. This is likely to be the case.
And to save resources, it would be good to monitor window activity and not generate a bitmap if the window is not active.
It's worth checking rather than making assumptions.
What we have found out:
In the test indicator, the counter is saved in the kanvas resource.
What has been found out:
In the test indicator, the counter is saved in the kanvas resource.
your indicators (or EA) do not work if the window is not active - i.e. the user cannot use multiple copies simultaneously on different charts.
so it's obvious your mistake - use the same resource in many charts in many indicators.
your indicators (or EA) don't work if the window is not active - i.e. the user can't use several copies of them simultaneously in different charts.
And when resources are the same, they are redrawn for all copies.
Checked your code in "windowed" mode and on the same chart - the size is the same.
For "expanded" mode, the size changes, but it's an ancient bug, it is several years old.
What does the operation of the indicator and graphical output have to do with it?
i mean that if the window is inactive and you recommend not to refresh the canvas - it means that
ps. and consequently - panels will not work thanks to your advice :)
i.e. visually in "windowed" mode, indicators (and EA) will not update.
ps. However, if the check only in OnChartEvent, it should work, I need to check.
When resources are the same, they are redrawn for all copies.
they are not the same
if the window is inactive, you recommend not to update the canvas - this means that
i.e. visually in "windowed" mode, indicators (and EA) will not update.
yes, was wrong with CHART_BRING_TO_TOP
should use the fxsaber option
What has been found out:
In the test indicator, the counter is saved in the kanvas resource.
Perfect. Now you can tell exactly how things work, rather than guessing. Will be useful to anyone working with CCanvas.
Ah, doesn't this theme in the debug work anymore?
Too bad :((( It was very useful in my work
What build do you have, beta or release?
What build do you have, beta or release?
You are probably in beta. Thought this feature was gone in beta version. But I checked my own (build 3091, release version) and it doesn't work either.