How do I make the output on a chart in monospaced font? - page 7

 
Renat Fatkhullin:

What's the problem with thinking about it and improving it drastically?

There's already a MQL4-MQL5 library in "it works and it's great" mode that is tearing your hair out. People are seriously using it to compare the speed of both platforms.

And now you're offering not to think, but to create a new cutting-edge tool that will be hauled around saying "MT5 is slower".


I do not understand anything. I suggest, once again, if fxsaber has the time and desire:

1. Make a library for MT5 (optionally for MT4), which would disable unnecessary functions (for now, graphics) in tester/optimizer mode

2. To do this, wrap these costly functions in defines and, depending on the mode of operation, enable or disable them

There is no need to be so emotional about it, nobody is attacking MT5.

 
fxsaber:

There is a universal tool that allows you to measure the performance of code in the tester with one line. We managed to see a lot of things there. In particular, that a single run is slower than an optimization run.

On the subject of the comment, the developers gave their answer. So far, I myself accelerate the optimization by 1.5-2 times by a single line.

And the SD told me about an important nuance for performance.


Worrying about microseconds of function execution is reasonable only in optimization modes. In real-time, it makes no difference. And the Comment does not play any role in the performance of the Expert Advisor in real-time, even if it is an order of magnitude slower.


But it's a fact that almost no one writes EAs in such a way that they run as fast as possible in the tester.

Please write a FAQ on how to achieve this. Please have all your thoughts in one place. We will put them in your blog, other places, I may make a video clip on youtube and put it on the MQ channel. You undoubtedly have vast experience in such systemic things, let's share for the common good!
 
Alexey Volchanskiy:
Please write a FAQ on how to achieve this. Let all the thoughts be in one place.

There's a great thread just for that. Perhaps someone will spend a lot of time and effort compiling a section-by-section FAQ based on the many posts in this thread.


And for performance, I always use the same recipe - TesterBenchmark + profiler. And of course, find a reasonable balance between the features of the tester and the real trade. That's how MT4Orders is written. The program is aimed at quick work in the tester and ideal work on the real account. For this purpose we need to understand that there are some (sometimes expensive) checks in the same tester that are not necessary for the real trading. This results in great savings. And caching of the same history, etc. I.e., it is necessary to write libraries that sometimes have in their guts different logics for tester and real. Trade.mqh, unfortunately, is not such a library.

Особенности языка mql5, тонкости и приёмы работы
Особенности языка mql5, тонкости и приёмы работы
  • 2017.02.24
  • www.mql5.com
В данной теме будут обсуждаться недокументированные приёмы работы с языком mql5, примеры решения тех, или иных задач...
 
fxsaber:

There's a great thread just for that. Perhaps someone will spend a lot of time and effort compiling a section-by-section FAQ based on the many posts in this thread.


And for performance, I always use the same recipe - TesterBenchmark + profiler. And of course, find a reasonable balance between the features of the tester and the real trade. That's how MT4Orders is written. The program is aimed at quick work in the tester and ideal work on the real account. For this purpose we need to understand that there are some (sometimes expensive) checks in the same tester that are not necessary for the real trading. This results in great savings. And caching of the same history, etc. I.e., it is necessary to write libraries that sometimes have in their guts different logics for tester and real. Trade.mqh, unfortunately, is not such a library.

That's what I was getting at in my previous posts. Making a FAQ on the above branch is the task at most. Let's take the humble task of making a FAQ on speeding up optimization. You just write your thoughts, if there is any code, add code. I will try to summarize it, brush it up and then we will agree upon it and post it. I will make the clip, I have a lot of experience, no problem.
 
Alexey Volchanskiy:
Let's take a modest task - to make a FAQ on speeding up optimization.

Altruism is sometimes a good thing. But time doesn't belong to me, it belongs to the Family.

Humble codes and recipes are shared. This seems sufficient.

I do not possess any secrets.

 
fxsaber:

And it does so correctly. It makes as much sense as not doing a ChartRedraw after changing an object's properties. To use the terminology

ChartRedraw should be called after mass write, not after every write.

Yes, but if I have small canvas, say 130x80 pixels, which is less than 1% of total window and I need to output current information into it. So in MT4 I can do it without redrawing the whole screen with Update(false), but in MT5 I have to redraw the whole screen every time. And it's a couple of orders of magnitude more resource-intensive. And this is not a test, but a working topic.
 
Nikolai Semko:
Yes, but if I have a small canvas, say 130x80 pixels, which is less than 1% of the total window, and I need to display current information in it. So in MT4 I can do it without redrawing the whole screen with Update(false), but in MT5 I have to redraw the whole screen every time. And it's a couple of orders of magnitude more resource-intensive. And this is not a test, but a working topic.

I'm sure the screen is never partially redrawn when kanvas or any other action.

 
fxsaber:

Altruism is sometimes a good thing. But time doesn't belong to me, it belongs to the Family.

Humble codes and recipes are shared. This seems sufficient.

I don't have any secrets.


Modesty is great! I am a modest person too. Altruism is for the deceased Mother Teresa in most cases. Although, sometimes the roots of this bad illness - altruism - sprout up in me too )))

 
fxsaber:

Surely the screen is never partially redrawn when kanvas or any other action.


Yes, I was wrong. I was wrong in saying thatResourceCreate without ChartRedraw in MT4 redraws the canvas every time. It does it only once in a while, while MT5 does not do that at all.

Yes, of course I'm dumb. At the hardware level the screen context cannot change only a part of the screen, but the whole screen.
I understood it when I introduced a small delay Sleep(10):

Files: