
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have a similar thing. But the problem is that you don't get the information all the time, as many times the event is missed/forgotten/not happening.
For such cases, I have a ChartChanged() function in this library, which forcibly updates all the chart parameters. I mainly use it in the tester mode.
Yeah of course, right decision. I even transfer all the buffered values to the indicators and no indicator never uses any ChartGetWhatever function. Its all just hell of work to create all these workarounds and it took me months to figure out that the parallel access of any Chart values from EA and indicators is the reason for freezes of the whole MT terminal.
A pity.MQL is simply highly critical when its getting complex. Its a fact and I would wish so much, that MQ would offer to cooperate with professionals like us. But thats just a wish. For quite a while I was in contact with Renat directly, but from some time, he simply didn´t reply anymore at all.
Long term, the only way out of this is to develop whatever is possible in C# and (mis)use MQL as a host to exchange data and receive commands from C#. This is what I am working on in the meanwhile and its the most stable solution. The pipes are written in native C and I can choose between sycnhronous and asynchronous transfer. All visual stuff is executed in a separate thread. Funfact: It takes 20 microseconds to convert the whole metrics data plus all colors into a byte stream, 10 microseconds to transfer, 20 microseconds to convert the data back to a structure in C# - but 1.000 times more to execute ONE ChartGetInteger() function in MQL plus same time again in timer just to check. That is a massive bottleneck and nothing in CCanvas, as nice as it is, can make that up.
All u can do with CCanvas, can then also be done with GDI, since CCanvas is 1:1 the same basis anyway. And with some tricks, you can use the C# Graphics GDI functions to write directly into the same array - also async in another thread without sending back the bitmap first.
In the long run, the only way out is to develop everything possible in C# and (incorrectly) use MQL as a host to exchange data and get commands from C#.
for drawing in Canvas
you can use cairo https://cairographics.org/, take as surface (initial, the same as in Canvas) an array of pixels, format ARGB32 and go with a song....
Here is an example, but through a separate DLL. To write #import to API cairo_XXX honestly lazy.
MQL:
C
H
and the result of course :
but the approach will not work for a dying market :-))
But it closes a lot of problems and even raises the question of whether Canvas is necessary...if you can draw on a ready array of pixels with a normal stable, mature library.
to draw in Canvas
you can use cairo https://cairographics.org/, take as surface (initial, the same as in Canvas) an array of pixels, format ARGB32 and go with a song...
Here is an example, but through a separate DLL. To write #import to the API cairo_XXX honestly lazy.
MQL:
C
H
and the result of course :
but the approach won't work for a dying market :-)
But it closes a lot of problems. and even raises the question whether Canvas is necessary...if you can draw on a ready array of pixels with a normal stable, mature library.
Actually I was aiming initially at Blend2D https://blend2d.com but there are no ready binary packages with it for win, and I couldn't build it from sorts (some cmake tricks are like that).
The principle of use is the same (you can also provide a pixel array and use it to drive), but B2D is more optimised than cairo and it is multithreaded.
If I get my hands on it next weekend, I'll tell you how to use it.
Through the resource you can transfer a large amount of information from the tester to the Expert Advisor on the chart and trade with the panel by hand too. The system is certainly more complex than checking the states of buttons of the "dead" panel in the tester, but the possibilities are much greater.
Such a tandem cannot be sold on the Market. And the level of buyers there is not very good for such complexities. I often meet complaints like:
- I bought an Expert Advisor for MT5, but it does not work under MT4, how can I fix it?
to draw in Canvas
you can use cairo https://cairographics.org/, take as surface (initial, the same as in Canvas) an array of pixels, format ARGB32 and go with a song...
Here is an example, but through a separate DLL. To write #import to the API cairo_XXX honestly lazy.
MQL:
C
H
and the result of course :
but the approach won't work for a dying market :-)
But it closes a lot of problems. and even raises the question whether Canvas is necessary...if you can draw on a ready array of pixels with a normal stable, mature library.
and without external additional DLL, exclusively API cairographics.org
draws :-) WORKS !!!
You can't sell a tandem like this on the Market.
...
If it is the same one, then yes, I didn't think of it somehow ))) But I foresee a lot of problems with users, most of them are below the plinth level.
If it's the same one, then yes, I didn't think of it somehow )) But I foresee a lot of problems with users, most of them are below the plinth level.