Libraries: Comment

 

Comment:

A simple replacement for a comment

Comment

Author: Aleksandr Slavskii

 
Awesome speed difference ...
 
Hi! That's great what you made for the comments on the chart. Can you help with adding comments in the MQL5 code that would show up next to the open position Buy or Sell in the terminal. I want to add comment for every type of signal that triggers opening the position in my EA. 
 

Hi.

This include worked great for speeding up testing.

However, I just noticed a new warning when I compile my EA related to canvas.mqh and rect.mqh

'struct CPoint' initialized from type type 'CPoint' using assignment operator, this behavior is deprecated and will be removed in future Canvas.mqh 2898 17

Perhaps you can address this for us.

Thanks

Kishore

 
kishore.bharat #:

Hi.

This include worked great for speeding up testing.

However, I just noticed a new warning when I compile my EA related to canvas.mqh and rect.mqh

'struct CPoint' initialized from type type 'CPoint' using assignment operator, this behavior is deprecated and will be removed in future Canvas.mqh 2898 17

Perhaps you can address this for us.

Thanks

Kishore

Hello Kishore,

That is not a problem with the code supplied by Aleksandr Slavskii, but it's a problem in the Canvas.mqh library supplied by Metatrader (only occurred on the latest update, build 5200 released on August 1 2025). I assume Metatrader will fix this in the future. For now, we have to put up with the warning.

Cheers

 
This code clears the warning
Does it work? You tell me

   for ( int i= 0 ; i<imin; i++)
     {
       //CPoint tmp=p[0]; 
      CPoint tmp;
      tmp.x = p[ 0 ].x;     
      tmp.y = p[ 0 ].y;

       ArrayCopy (p,p, 0 , 1 );
      p[total- 1 ]=tmp;
     }
 
Gerard William G J B M Dinh Sy #:
This code clears the warning
Does it work? You tell me

It works perfectly. Thanks Sir.

 
Harry Santoso # :

It works perfectly. Thanks Sir.

To be honest it wasn't very complicated lol

 

Thanks madcedar for your comment on canvas.mqh. Will watch out for the update

And thanks Gerard William G J B M Dinh Sy for the interim code fix.

madcedar
madcedar
  • 2017.03.20
  • www.mql5.com
Trader's profile
 
Gerard William G J B M Dinh Sy #:

To be honest it wasn't very complicated lol

it could be even easier lol

for ( int i= 0 ; i<imin; i++)
     {
      CPoint tmp;
      tmp = p[0];   

       ArrayCopy (p,p, 0 , 1 );
      p[total- 1 ]=tmp;
     }