Canvas is cool! - page 76

 
Vitaliy Kuznetsov graphical elements, the indicator with a dashboard (any) will hang the terminal when switching because of the Expert Advisor.

But I saw with my own eyes, a panel that works without hangs and surprisingly not conflicting with different products with events, timers and mouse tracking. That is, without direct crutches linking products that I can write myself.

The author was silent on my request to share the solution)


What are your thoughts on an EA with canvas graphics, so that it does not react to switching the dashboard through the indicator? Delays can be prescribed or something else. Question on MT4


If you know but don't want to tell everyone for some reason, but are good at kanvas, then email me to place an order via freelance. But you'll have to wait a couple of weeks for the account to be funded with the right amount.

Anyway, I plan to post a couple of simple canvas assignments, as I don't have the brains to solve some of the nuances with conflict-free. And once again, it's solvable as I've seen it with my own eyes. The code there is closed, a product of the market, so I can't tell you anything more about it.

The basic algorithm of the Expert Advisor or indicator can sit in the second window and do all the work on the first.... Thus, whatever happens in the first window, it will always depend on the work of the advisor or indicator in the second window.

 
Vitaliy Kuznetsov graphical elements, an indicator with a dashboard (any) will hang the terminal when switching because of the Expert Advisor.

But I saw with my own eyes, a panel that works without hangs and surprisingly not conflicting with different products with events, timers and mouse tracking. That is, without direct crutches linking products that I can write myself.

The author was silent on my request to share the solution)


What are your thoughts on an EA with canvas graphics, so that it does not react to switching the dashboard through the indicator? Delays can be prescribed or something else. Question on MT4


If you know but don't want to tell everyone for some reason, but are good at kanvas, then email me to place an order via freelance. But you'll have to wait a couple of weeks for the account to be funded with the right amount.

Anyway, I plan to post a couple of simple canvas assignments, as I don't have the brains to solve some of the nuances with conflict-free. And once again, it's solvable as I've seen it with my own eyes. The code there is closed, a product of the market, so I can't tell you anything more about it.

An indicator with a dashboard will not hang an Expert Advisor, if the indicator is properly made. Drawing/calculation of the dashboard is separated and optimised. Basically, I wrote in the blog, and there is nothing super-fantastic. You just don't need to draw anything in OpCalculate and you should memorise your own data, not search for it on the chart, in quotes or trading history. The same applies to Expert Advisors

 
Vitaliy Kuznetsov graphical elements, an indicator with a dashboard (any) will hang the terminal when switching because of the EA.

I don't know ) Can you give me an example of such an indicator? And what kind of switching?

 
Oleksii Chepurnyi #:

I don't know ) Can you give me an example of such an indicator? And what is the switch?

Any indicator with a dashboard, i.e. when you click on it, it switches pairs in the current window.

And any Expert Advisor that has a graphical part.

 
Vitaliy Kuznetsov #:

Any indicator with a dashboard, i.e. when you click on it, pairs in the current window are switched.

And any Expert Advisor that has a graphical part

I do not use indicators ) I don't even know all the standard ones )

And I don't want to waste my time looking for something I don't understand at all.

There is an Expert Advisor with graphics

 
Vitaliy Kuznetsov graphical elements, an indicator with a dashboard (any) will hang the terminal when switching because of the Expert Advisor.

But I saw with my own eyes, a panel that works without hangs and surprisingly not conflicting with different products with events, timers and mouse tracking. That is, without direct crutches linking products that I can write myself.

The author was silent on my request to share the solution)


What are your thoughts on an EA with canvas graphics, so that it does not react to switching the dashboard through the indicator? Delays can be prescribed or something else. Question on MT4


If you know but don't want to tell everyone for some reason, but are good at kanvas, then email me to place an order via freelance. But you'll have to wait a couple of weeks for the account to be funded with the right amount.

Anyway, I plan to post a couple of simple canvas assignments, as I don't have the brains to solve some of the nuances with conflict-free. And once again, it's solvable, since I've seen it with my own eyes. The code there is closed, a product of the market, so I can't tell you anything more about it.

Is the problem similar to this one?
https://www.mql5.com/ru/forum/425642

So, there is an inducer that builds some panel and the Expert Advisor uses it (this inducer)?

Функции OnChartEvent и OnTimer не работают во вложенных индикаторах?
Функции OnChartEvent и OnTimer не работают во вложенных индикаторах?
  • 2022.05.22
  • www.mql5.com
Возникли вопросы по работе индикаторов...
 

Draw in init and only if not already drawn. In deinit, check the reason for deinitialisation. If the reason is deinitialisation, then delete the graphics, in all other cases leave them, so that you don't have to draw them in init again.

And this is not a trick, but just a reasonable approach to the matter.

But for some people it is certainly a thicket, and before getting into the thicket it would be worthwhile to learn how to write indicators, and not to recalculate 1000 bars on every tick.

And why do we need these dashboards in the first place? Haven't you played gta?

 
Yevhenii Levchenko #:

Is the problem similar to this one?
https://www.mql5.com/ru/forum/425642

So, there's an indictor, which builds some panel and it (this indictor) is used by the Expert Advisor?

The "problem" given in the link is solved via ChartIndicatorAdd - the Expert Advisor "attaches" the indicator to the chart and OnChartEvent starts to fly to this indicator.

 
Vitaliy Kuznetsov graphical elements, an indicator with a dashboard (any) will hang the terminal when switching because of the Expert Advisor.

But I saw with my own eyes, a panel that works without hangs and surprisingly not conflicting with different products with events, timers and mouse tracking. That is, without direct crutches linking products that I can write myself.

The author was silent on my request to share the solution)

What are your thoughts on an EA with canvas graphics so that it doesn't react to dashboard switching via indicator? Delays can be prescribed or something else. Question on MT4

If you know but don't want to tell everyone for some reason, but are good at kanvas, then email me to place an order via freelance. But you'll have to wait a couple of weeks for the account to be funded with the right amount.

Anyway, I plan to post a couple of simple canvas assignments, as I don't have the brains to solve some of the nuances with conflict-free. And once again, it's solvable as I've seen it with my own eyes. The code there is closed, a product of the market, so I can't tell you anything more about it.

It's all about the correct internal event model.
A reasonable mql programmer should take care of creating his own event model and listening to these events, especially if he deals with canvas.
Since kanvas in MQL is implemented rather low-level without asynchrony (only Update (more precisely ChartRedraw) is asynchronous).
That is why without a normal event model an Expert Advisor can be heavily suspended by kanvas. And this will happen not because the canvas is slow, but because it is used uncontrollably.
In simple words - if an important event occurs - for example, something related to making a decision to open a trade and placing the trade itself, then everyone stands and waits. Canvas in this hierarchy should occupy almost the last place.
The calculation of canvas should also be based on the last time when canvas was calculated. The canvas calculation should also be interrupted when a new event for the canvas is received (e.g. a mouse move or a button press that should lead to a new recalculation of the canvas). This is called event listening.

Moreover, I personally believe that it is harmful to use external indicators (iCustom) in an Expert Advisor, and that all indicator calculation should be done inside the EA (now I'm going to be attacked :)), but, again, with a competent event model with listening.
Although iCustom is executed in a different thread, but the process is the same. That's why it's an illusion that something is parallelised there. Moreover, all these interactions between threads are not free at all.
A vivid example is single-threaded JS. JS has a very competent high-level implementation of the event model with event listening. So when I create complex animated interfaces on pure JS, there are no lags at all.
At the same time, JS is about a couple of times slower than MQL5, and JS has 64 frames per second, while MQL has 32
Unfortunately, MT has a very crooked implementation of the event model with listening to these events. That's why interfaces often look laggy, especially when the programmer does not use his own event model.
And the semantic bugs in MT asynchrony have been known for a long time.
I already addressed Renat twice on the forum, but he said - no, we won't change anything.
Why - is a mystery to me.

 
Nikolai Semko #:

...
Moreover, I personally think that it is harmful to use external indicators(iCustom) in EA
...

If you don't know how to write indicators.

Inventors of the bicycle.