Canvas vs Labels - page 17

 
Mihail Matkovskij:

On the subject of g-code, I can find your g-code by arguing every word I say! Not like you, blaming...Find it?

I'm not a programmer. I'm self-taught. You can poke at any of my code and call it whatever you want, but no matter how you look at it, my codes are far from the most g...

 
Artyom Trishkin:
A topic of interest has been trashed... What kind of people...

The subject could have been interesting. But alas, it will never be.

 
Alexey Viktorov:

I am not a programmer. I'm self-taught. You can poke at any of my code and call it whatever you want, but no matter how you look at it, my codes are far from being the most g...

But the codes of other members of the community, to you, are... Well, you're obviously self-taught. So you don't need unwritten rules that say you can't trash your colleagues.

Now for the code questionshttps://www.mql5.com/ru/code/24076. Of course I won't be like you and say it's crap code... But I will make my remarks all the same.

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
   calculate();
   ArrayFill(extImg1, 0, IMG_WIDTH1*IMG_HEIGHT, 0);
   textComment(dts(lots[0])+" ", IMG_WIDTH1, 1, extImg1);
   textComment(dts(lots[1])+" ", IMG_WIDTH1, 2, extImg1);
   textComment(dts(lots[2])+" ", IMG_WIDTH1, 3, extImg1);
   textComment(dts(lots[3])+" ", IMG_WIDTH1, 4, extImg1);
   textComment(dts(lots[4])+" ", IMG_WIDTH1, 5, extImg1);
   textComment(dts(lots[5])+" ", IMG_WIDTH1, 6, extImg1);
   textComment(dts(lots[6])+" ", IMG_WIDTH1, 7, extImg1);
   textComment(dts(lots[7])+" ", IMG_WIDTH1, 8, extImg1);
   ResourceCreate("::bbb", extImg1, IMG_WIDTH1, IMG_HEIGHT, 0, 0, IMG_WIDTH1, clr_format);
  //ChartRedraw();
//--- return value of prev_calculated for next call
   return(rates_total);
}

Why isn't there any limitation on BitmapLabel update frequency, if it will work in tester, on "all ticks" model? Do you hope, that a modern iron will digest everything?) Where's the optimisation? And you suggested this to me, when I was looking for a way to output text from high-loaded processes (output in tester, on " all ticks " model , and on the chart in loop)?

And when I said it didn't work for me every tick...

https://www.mql5.com/ru/forum/1111/page2979#comment_21212761

Why not use CCanvas, which is specially designed for this purpose? True, I looked, you wrote somewhere that it supposedly calls unnecessary functions etc. So you didn't do the update frequency limitation for the tester, but at the same time, the CCanvas functions somehow hindered you... :)

Strange...


And now it's your turn to tell me exactly why you think my code is "g-code". Only, with arguments, not idle chatter!

 
Artyom Trishkin:
You're cluttering up an interesting topic... What kind of people...

All I did was accept an offer to participate in the test, which led to the need to ask the invitee a couple of questions...

 
Mihail Matkovskij:

...

Why is there no limit to the BitmapLabel update frequency if it's going to run in a tester, on an "all ticks" model? Are you hoping that modern iron will digest everything?) Where's the optimisation? And that's what you suggested to me, when I was looking for a way to output text from highly loaded processes (output in tester, on all ticks model , and on chart in loop)?

...

And why, because you yourself claim that a bitmap label is faster than a regular label. And a single regular label in this case would be almost invisible in terms of performance.

 
Dmitry Fedoseev:

All I did was accept an offer to take part in a test, which led to me having to ask the invitee a couple of questions...

"A thief's hat is on fire"?... Anyone can download the source code and repeat the measurements I presented above! You have only complaints and grievances. Invented, "broken links" and the like...
Dmitry Fedoseev:

Why, because you yourself claim that the bitmap label is faster than the regular label.

I didn't say that. And I was talking about outputting information on more than one line. That's why I made a display to output a large number of lines to measure it.

Output to Labels optimises the chart. Whereas in BitmapLabel you need to pass an array of pixels, pre-filling it. In this case, it is filling the pixel array and outputting text to it. All these operations, if called too often, put a strain on the application. Whereas for the label you only need to pass a string. This has already been mentioned above.

You can find out more about speed by comparing CCanvas and label speed measurements in different modes:https://www.mql5.com/ru/forum/364640/page13#comment_21314045

 
Mihail Matkovskij:

But the codes of other members of the community for you g... Well, you're obviously self-taught. That's why you don't need unwritten rules that say you can't trash your colleagues.

And now the questions about the code. I won't be like you and say it's crap code... ...but I'll make my own comments nonetheless.

Why isn't there any limitation on BitmapLabel update frequency, if it will work in tester, on "all ticks" model? Do you hope, that a modern iron will digest everything?) Where's the optimisation? And you suggested this to me, when I was looking for a way to output text from high-loaded processes (output in tester, on " all ticks " model , and on the chart in loop)?

And when I said it didn't work for me, you started voicing your grievances to me... Allegedly, I don't understand anything and had to call TextOut - ResourseCreate - ChartRedraw mercilessly . True,ChartRedraw is commented out for some reason...


Why not use CCanvas, specially designed for this purpose? True, I see you wrote somewhere that it supposedly calls unnecessary functions, etc. So you haven't done a limitation on the frequency of updates for the tester, but at the same time, the CCanvas functions have somehow hindered you... :)

Strange...


And now it's your turn to tell me exactly why you think my code is "g-code". Only, with arguments, not idle chatter!

  1. What planet do you live on? Where did you find such rules? Come to any service station and hear all about who repaired your car last time. Even if it was the one you're talking to now. And it's not just cars. It's just the most obvious example.
  2. I offered you this code as an example, not to blindly copy it.
  3. All the checks and delays overload the code and it is more difficult to use such a code as an example.
  4. What kind of optimization are we talking about if the EA is not a trading one? What parameters are to be optimized in it?
  5. After you have rejected my proposal, Nikolay started to explain all the details to you. I just advised to look through his topic on Canvas. You lied and said that you have read everything. How do you want them to treat liars (to put it mildly)?

Let the flies and dung beetles poke around in your code. I have enough other interesting and useful things to do.

 
Mihail Matkovskij:
"A thief's hat's on fire"?... Anyone can download the source code and repeat the measurements I presented above! You, on the other hand, have nothing but complaints and grievances. Invented, "broken links" and the like...

I did not say that. And I was talking about outputting information on more than one line. Therefore, for measuring, I made a display to output a large number of lines.

Output to Labels optimises the chart. Whereas in BitmapLabel you need to pass an array of pixels, pre-filling it. In this case, it is filling the pixel array and outputting text to it. All these operations, if called too often, put a strain on the application. Whereas for the label you only need to pass a string. This has already been mentioned above.

You can learn more about speed by comparing CCanvas and label speed measurements in different modes:https://www.mql5.com/ru/forum/364640/page13#comment_21314045

Well in general, unabashed shamelessness and impudence.

 
There is a quote with links in this comment. These links still allow you to download a file with a class that doesn't have a limitFps field, but it is referenced. Also tell me that I "drew" such links myself.
 
Alexey Viktorov:
  1. What planet do you live on? Where did you find such rules? Go to any car service and you'll hear all about who repaired your car last time. Even if it was the one you're talking to now. And it's not just cars. It's just the most obvious example.

Obviously, we're on different planets if you follow that paradigm...!

The car workshop gives me an example... :) Well, at least you've cheered up this morning. :)

Alexey Viktorov:

I offered you this code as an example...

Then I ask again, what's the difference between Kanvas and me? It works in the same way. Only the functions you need are not eliminated, like in your example. The only difference is that it is OOP, a totally different level, not your procedural programming. :)

Alexey Viktorov:

All the checks and delays overload the code and such code is harder to use as an example.

Of course, of course... Overwrite... You are not very good at code either! You'll probably be answered with an excuse: Well, I'm not a programmer... :) You're just trying to teach others. :)

Alexey Viktorov:

What kind of optimization we are talking about if the Expert Advisor is not a trading one? What parameters should I optimize in it?

I'm confused in terms of terms :) I was talking about optimizing the Bitmap Label refresh rate. Which you have not done and offered me your example to be used in high load processes.

Alexey Viktorov:
  1. After my offer was rejected, Nikolai started explaining all the subtleties to you. I just advised you to look at his topic about kanvas. You lied and said you have read it all. How do you want to treat liars (to put it mildly)?

In this case, the liar is you! Because I didn't say that. All I said was, why would I want another Canvas-based library. In fact, another Canvas. You offered me the same Canvas and it works exactly the same. Nikolay had no desire to explain what to do to make Kanvas work fast in my task. And you obviously do not have the appropriate knowledge. You told Nikolai "don't waste your time on him". He said "I agree". That's your and Nikolai's explanation. Programmers...

Alexey Viktorov:

Let the flies and dung beetles poke around in your code. I have enough other interesting and useful things to do.

I won't say yours is true... But I agree with you on one thing. You really don't have to. Why should I need the conclusions of an amateur...? Better go to an auto repair shop...

That's it. I won't give you any more detailed answers. Because it's a waste of time. I'd rather do something useful!