Errors, bugs, questions - page 2266

 
fxsaber:
So, have we solved the "squares" problem?

Of course, if you use one non-scalable canvas, there just isn't any.

I want to publish in KB a simple iCanvas class, which inherits CCanvas class, which creates a full screen canvas when declared by default and then changes it automatically if window size changes.

There will also be some additional features in the form of drawing canvas shapes not by x-coordinates but by price, bar number or time. I.e. we will add functions X(datatime T), X(double bar), Y(double price).
So that kanvas doesn't seem so stressful to many people.

 
Nikolai Semko:

Of course, if you use a single unscaled kanvas, they just don't exist.

I've always had one kanvas and the red square kept popping up. I struggled for a long time to understand the reasons, but never got around to it.

 
fxsaber:

I've always had one kanvas and the red square kept popping up. I struggled for a long time to understand the reasons, but never got around to it.

If you resize kanvas, i.e. open it again or use Resize function, you should use kanvas for the whole window to avoid such red squares.

#include <Canvas\Canvas2.mqh>

int OnStart(void)
  {
    int Width=(int)ChartGetInteger(0,CHART_WIDTH_IN_PIXELS);
    int Height=(int)ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS);
    CCanvas canvas;
    if(!canvas.CreateBitmapLabel("SampleCanvas",0,0,Width,Height,COLOR_FORMAT_ARGB_NORMALIZE)) Print("Error creating canvas: ",GetLastError());
  ....
  }

Also remember that Erase function is very fast - full screen FullHD will take ~0.5 milliseconds.

And Update slower ~5-7 milliseconds on full screen FullHD.
Yes - this option is more costly, as Update kanvas size of say 500x200 will take ~0.5 milliseconds.

So it's a matter of expediency.

Personally I almost always use full screen kanvas now, as I have 200 fps margin with Update = 5 milliseconds.

 

Is there any way to fix this by the next build?

When I switch to another account, the custom character chart loses bars - "Waiting for update". Bars cannot be requested. At the same time ticks - no problem.

After restarting the Terminal, of course, the bars on the chart are available.

I would like the custom symbol bars to remain available without rebooting after switching to another account.

 
If you create a "synthetic tool" and the computer crashes, the synthetic tool is not saved. A small thing, but inconvenient. Please fix it.
 
It turns out that the backtest ends on the penultimate (not the last, as you might think) tick of the testing interval.
 

Error during execution:

#define  MACRO( int ) int
void f( uint ) { Print( 1 ); }
void f(  int ) { Print( 2 ); }
void OnStart()
{
        MACRO( uint ) x = 0;
        f( x );
}

Result: 2 Expected: 1

 

It must be a psychological aberration to know, at any time, the number of the latest MT5 build.

I don't know the current exchange rates, but I always know the number. Ask me today, a month ago, a year ago...

 
Compilation error:
class A {
template<typename T>
        A *StringFormat( string, T ) { return &this; }
        A *f() { return StringFormat( "", 1 ); } //Error: 'StringFormat' - object pointer expected
};
 
All the same, the tick history of the custom characters disappears after the Tester is applied to them. It should be fixed.