Impossible to create a rectangle on the chart

 

I see EA's that have a nice rectangle as the information text background, works nicely for them.

However, I can't do that with MQL4 scripting. It just doesn't work, I have tried everything that I thought of, googled around as well. My rectangle always comes white, no matter what color I give it. Secondly, it always covers the text objects, it seems impossible to create a background rectangle.

Can anyone shed some light on this weird mystery?

Files:
mt4.JPG  12 kb
 

Do you really expect an answer? There are no mind readers here and our crystal balls are cracked, so we can't see your machine.
     How To Ask Questions The Smart Way. (2004)
          Be precise and informative about your problem

We can't see your broken code.

Always post all relevant code (using Code button) or attach the source file.

 
William Roeder #:

Do you really expect an answer? There are no mind readers here and our crystal balls are cracked, so we can't see your machine.
     How To Ask Questions The Smart Way. (2004)
          Be precise and informative about your problem

We can't see your broken code.

Always post all relevant code (using Code button) or attach the source file.

Sorry I forgot to add it. No need to be sarcastic. :)

Here is the code:

   int rectangleWidth = 200;
   int rectangleHeight = 220;
   int rectangleColor = clrBlue;
   int rectangleCorner = CORNER_LEFT_UPPER;

   string rectName = "InfoBackground";
   ObjectCreate(0, rectName, OBJ_RECTANGLE_LABEL, 0, 0, 0);
   ObjectSet(rectName, OBJPROP_XDISTANCE, 10);
   ObjectSet(rectName, OBJPROP_YDISTANCE, 20);
   ObjectSet(rectName, OBJPROP_XSIZE, rectangleWidth);
   ObjectSet(rectName, OBJPROP_YSIZE, rectangleHeight);
   ObjectSet(rectName, OBJPROP_COLOR, rectangleColor);
   ObjectSet(rectName, OBJPROP_CORNER, rectangleCorner);

   ObjectSetInteger(0, rectName, OBJPROP_SELECTABLE, false);
   ObjectSetInteger(0, rectName, OBJPROP_SELECTED, false);
   ObjectSetInteger(0, rectName, OBJPROP_SELECTED, true);
   ObjectSetInteger(0, rectName, OBJPROP_SELECTED, false);
 
William Roeder # :

¿Realmente esperas una respuesta? Aquí no hay lectores de mentes y nuestras bolas de cristal están rotas, por lo que no podemos ver su máquina. Cómo hacer preguntas de forma inteligente . (20 04 ) Sea preciso e informativo sobre su problema
     
          

No podemos ver su código roto.

Publique siempre todo el código relevante (usando el botón Código ) o adjunte el archivo fuente.

Please:
1. If you do not know an answer, do not post.
2. If you know the answer but do not intend to share it, please do not post.
3. Do not use sarcasm or irony in the "Answers" you give. We are not to blame for your problems
 
Diego Esquivia #: 1. If you do not know an answer, do not post.

Why did you post snowflake? You didn't answer OP's question.

 
Tarmo Tammistu #: Sorry I forgot to add it. No need to be sarcastic. :)
   ObjectSet(rectName, OBJPROP_COLOR, rectangleColor);
Try OBJPROP_BGCOLOR
 
William Roeder #:
Try OBJPROP_BGCOLOR

Man, that did the trick! :O Much appreciated!

Then I tried to add the following code to the background (with the Z value 1) and for text objects with the Z value 2 (should bring the text forward), but it has no effect. The background still covers the text. The text objects are currently created before the background rectangle, and I tried this both ways, but nothing changed.

ObjectSetInteger(0, rectName, OBJPROP_ZORDER, 1);
Reason: