Features of the mql5 language, subtleties and tricks - page 165
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
Yes, I have history reading present.
Forum on trading, automated trading systems and strategy testing
Libraries: Easy Canvas
Nikolai Semko, 2020.02.17 05:15
I want to clarify an important point for interested programmers when operating the kanvas in tester mode.
A well-known programmer in this community came to me with this question:
- Why in tester-mode my panel, created on objects is redrawn much faster than drawn on canvas, while in normal mode my panel is drawn at normal speed on canvas?
I have managed to understand the reason for the problem and its solution.
The problem is that redrawing of objects goes together with redrawing of the whole screen, while the screen in the tester is redrawn no more frequently than 30 frames per second.
Objects are ultimately the same canvas (internal), but when you change the properties of the object, the object canvas is not generated (not recalculated), but generated only when the screen is updated (ChartRedraw), which occurs in the tester (and in normal mode, too) no more often than our eyes can distinguish changes, ie no more often than ~ 32 frames per second.
Suppose the panel changes every tick. Then the default canvas will also be redrawn every tick, but redrawing in the tester is still no more frequent than ~30 msec (~30 fps).
In other words, the canvas will be recomputed much more frequently than it is actually displayed on the screen, which results in a disproportionate use of resources.
The solution to this problem would be to ensure that canvas is recalculated and redrawn no more often than every 15-30 milliseconds of computer time, and then there will be no unnecessary cycles of empty recalculation.
For example, like this:
If, for example, I want to create file "EURUSD.txt" (large symbols) and there is already "eurusd.txt" (small symbols) on the disk, the file will have the same name as before.
Moreover, when I save EURUSD TicksLongOpt.set, eurusd tickslongopt.set is saved. I have to rename it afterwards. There are a lot of annoying little things like that.
Moreover, when I save EURUSD TicksLongOpt.set, eurusd tickslongopt.set is saved. I have to rename it afterwards. I have to rename it afterwards. There are many such annoying little things.
I think if I delete it first and then create it, everything will be fine.
I think if you delete first and then create, you'll be fine.
No, I mean creating a new file, specifically when saving from the terminal dialog. If it doesn't work for everyone, then it depends on something else. I have Win7, if anything.
No, I mean creating a new file, specifically when saving from the terminal dialog. If it doesn't work for everyone, then it depends on something else. I have Win7, if anything.
I meant FileOpen and FileSave functions.
I meant FileOpen and FileSave functions.
Yes, I've just realised now that it's out of place, the topic is about language...
Easy sorting an array of structures
Application
Result
It does not work, can you update it ? Sets template declarations are not allowed in local classes TestarrSort.mq5 81 3
Not working, can you update ? Writes template declarations are not allowed in local classes TestarrSort.mq5 81 3
Unfortunately, the language has been cut off. This code does not work.
But you may try an alternative variant.
SZZ Here is another example of usage.