Questions from Beginners MQL5 MT5 MetaTrader 5 - page 47

 
Can you please tell me if visualisation on remote agents is, I guess, categorially impossible? Or is it possible?
 
Dimka-novitsek:
Please tell me, visualization on remote agents, I guess, is not possible? Or is it possible?

Not possible because it's not needed, the remote agent is in process mode, it has no window (except the settings window).

It can only be seen through the task manager (but only the process, not what it's doing).

 
Here are the prints I read directly that don't come out... That's too bad. Generally if there is not even a small dot on the grey line of the course of optimisation after a sufficiently long period of time, what does it mean that there are simply no positive results? Then prints and visualization are necessary as well! But why does it not go? Tanks go, and ships are at war, and memory like 4 gig, and super video card, 1375 MHz something like that, and test it completely can not!!! At least slowly... The computer goes straight into knockdown with a blank screen.
 
Urain:
Not possible because you don't need it, the remote agent is in process mode, it has no window (other than the settings window).Thanks! Got it! Indeed!
 
Vladon:
For the clock, I'd like to use a non-standard font, if it were possible to store it directly in resources for example.
sergeev:
the text means not to lug around a separate ttf file, but embed it directly in ex5 as a resource.

That is, solely for drawing in a graphical bitmap/canvas?

Fonts will definitely not be embedded, but we may allow to use the standard Windows fonts for drawing in the kanvas.

 
Renat:

You mean exclusively for drawing in a graphical bitmap/canvas?

No, for efficient label drawing. The question is for the terminal to be able to take a font from resources and set it independently.
 
TheXpert:
No, for efficient label drawing. The issue is to allow the terminal to take a font from the resources and install it itself.
Unfortunately, no.
 
Renat:

So, exclusively for drawing in a graphical bitmap/canvas?

We will definitely not embed fonts, but we can let you use regular Windows fonts for drawing in the canvas.

I understand you will open up some GDI for Kanvas. That's great.

but there's a problem, I think, that lies at an ideological level in the principles of chart drawing.

Let me explain with two examples.

In order to use canvas more actively, you need a frame change. But in the terminal any object is not drawn until it is hidden from all timeframes(OBJ_NO_PERIODS). This leads to the fact that I can't prepare the object location and size if it's not drawn yet.

I brought up this topic both for output static text size and output bmp size - the answer was this - you draw with width = 1, and then ask the size from the object itself and you'll know exactly. And add here a minimum pause and necessity to call ChartRedraw... You'll agree that this is a crutch.

And we need to plump not just one static or bmp, but dozens of them. And if there's a lot of activity, you have to watch pauses in rendering.

--------------------

As for ubiquitous kanvas as an alternative to existing objects- that's utopia // although nice in an ideal world

No one in their right mind would draw a 10 megabyte bitmap and slow it down just for a diagonal line through a chart of 2096 by 1080 pixels


I fully support kanvas development // I support any development at all.

But the existing objects cover 95% of all business needs in the interface. Kanvas is an appendix to complicated business structures // very well demonstrated by Kohonen Maps. But they don't want to replace the objects completely.

( -5% is the developers' effort to avoid introducing a coordinate line. :) // but a dialogue has already started, hopefully we will come to a consensus)

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Свойства объектов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Свойства объектов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы объектов / Свойства объектов - Документация по MQL5
 

2012.10.20 14:21:46 Tester expert file C:\Users\Micha\AppData\Roaming\MetaQuotes\Terminal\FF783873B20D7FA177754FFD85AFB6\MQL5\Experts\Final.ex5 allocate error

2012.10.20 14:21:31 Core 2 authorized (agent build 695)

2012.10.20 14:21:16 Core 2 connecting to 127.0.0.1:3001

2012.10.20 14:11:10 Core 1 OpenCL device: NVIDIA Corporation GeForce 9600 GSO 1GB GPU with OpenCL 1.0 (12 units, 1375 MHz, 2048MB, version 301.42)

I'm sorry, what does this say? I understand that the error. What does it lack? ??

In general, the test hangs almost completely. Often it shuts down... But that same evening, there are very lively and beautiful games, tanks-world, stalker, etc.. !


 
sergeev:

But there is a problem, it seems to me, laid at the ideological level in the principles of rendering a chart.

In order to use kanvas more actively, you need to change frames. And any object in the terminal is not drawn until it is hidden from all timeframes(OBJ_NO_PERIODS). This leads to the fact that I cannot prepare object location and know its size, if it is not drawn yet.

Do you know about the perfect hint of backbuffering in our canvases and linking to an object on the screen?

We can draw frames perfectly, quickly and without artefacts. Take a look at the video example based on frame sequence generation in OpenCL Test.

Use a nice tactic:

  1. Create a Bitmap Label graphic object on the chart

       string objname ="OpenCL_"+IntegerToString(ChartID());
       string resname ="::Mandelbrot_"+IntegerToString(ChartID());
    //--- creating the object for graphics display
       ObjectCreate(0,objname,OBJ_BITMAP_LABEL,0,0,0);
       ObjectSetInteger(0,objname,OBJPROP_XDISTANCE,4);
       ObjectSetInteger(0,objname,OBJPROP_YDISTANCE,26);
    

  2. Create an empty graphical resource in memory and bind it to a previously created object:

    //--- create initial empty picture
       uint buf[];
    
       ArrayResize(buf,SIZE_X*SIZE_Y);
       ResourceCreate(resname,buf,SIZE_X,SIZE_Y,0,0,SIZE_X,COLOR_FORMAT_XRGB_NOALPHA);
       ObjectSetString(0,objname,OBJPROP_BMPFILE,resname);
    
    This is where the magic happens. The graphical object receives a direct binding to the graphical resource. And this binding is intelligent with caching, as it was specially created for quick paging and backbuffer handling.

  3. Now you can easily draw in your buffer without worrying about binding to an object on the screen

    //--- рисуем что хотим в buf
    ....
    
  4. And now it's time to display this updated bitmap on screen

          //--- saving the frame in memory and drawing it
          ResourceCreate(resname,buf,SIZE_X,SIZE_Y,0,0,SIZE_X,COLOR_FORMAT_XRGB_NOALPHA);
          ChartRedraw();
    
    To do this, we "rebuild" the resource (no rebuilding actually happens, because all sizes are the same), copy the new bitmap to it, and the change counters of this resource are incremented.

    Note that the graphical object objname itself isn't touched in any way as it's already associated with the resource.

    Then we call Screen Redraw via ChartRedraw which requires drawing of the graphical object. It is bound to our resource which it controls using the bitmap alteration counter. If the change counter of bitmap saved in the graphical object doesn't coincide with the counter of resource, the bitmap will be automatically copied to the graphical object and visualized in a protected way. If the counters are the same, then the picture is shown without any changes.

Here is a simple method of safe (from simultaneous access from MQL5 and the terminal rendering system itself) and quick work with rendering frames.

Reason: