Draw rectangle only with borders

 

Dear all, hope you are fine,

I need to draw rectangle objets but only with borders, no background (check attached samples).

Could you give me some code sample?

Thank you!

Files:
rectangles.jpg  27 kb
 
nandocabrera87: I need to draw rectangle objets but only with borders, no background (check attached samples). Could you give me some code sample?

Draw four lines (trendlines OBJ_TREND). Or use two channels (OBJ_CHANNEL), one for the vertical sides and one for the horizontal sides.

OBJ_TREND - Object Types - Objects Constants - Constants, Enumerations and Structures - MQL4 Reference
OBJ_TREND - Object Types - Objects Constants - Constants, Enumerations and Structures - MQL4 Reference
  • docs.mql4.com
OBJ_TREND - Object Types - Objects Constants - Constants, Enumerations and Structures - MQL4 Reference
 
nandocabrera87:

Dear all, hope you are fine,

I need to draw rectangle objets but only with borders, no background (check attached samples).

Could you give me some code sample?

Thank you!

If you do not set the rectangle object as a background, then you can also not fill it and just get the outline

   ObjectSetInteger(0,"Rectangle",OBJPROP_FILL,false);
   ObjectSetInteger(0,"Rectangle",OBJPROP_BACK,false);