Several object overlay (the same parameter) - which will be visible (on top)?

 

Hi,

I looking for answer at this situation. I have easy code, two or more object overlay with the same parameter, color is different.

In both cases I am always seeing on graph yellow line. Why I don´t  see once blue line and once yellow line?

Thank you for help.

   ObjectCreate("carah4", OBJ_TREND, 0, Time[10], 1.3340, Time[0], 1.3340);
   ObjectSet("carah4", OBJPROP_COLOR, Yellow );
   ObjectSet("carah4",  OBJPROP_RAY, 0 );
   ObjectSet("carah4",  OBJPROP_WIDTH, 3 );
   
   ObjectCreate("carad1", OBJ_TREND, 0, Time[10], 1.3340, Time[0], 1.3340);
   ObjectSet("carad1", OBJPROP_COLOR, Blue );
   ObjectSet("carad1",  OBJPROP_RAY, 0 );
   ObjectSet("carad1",  OBJPROP_WIDTH, 3 );


OR first create blue line now:

   ObjectCreate("carad1", OBJ_TREND, 0, Time[10], 1.3340, Time[0], 1.3340);
   ObjectSet("carad1", OBJPROP_COLOR, Blue );
   ObjectSet("carad1",  OBJPROP_RAY, 0 );
   ObjectSet("carad1",  OBJPROP_WIDTH, 3 );

   ObjectCreate("carah4", OBJ_TREND, 0, Time[10], 1.3340, Time[0], 1.3340);
   ObjectSet("carah4", OBJPROP_COLOR, Yellow );
   ObjectSet("carah4",  OBJPROP_RAY, 0 );
   ObjectSet("carah4",  OBJPROP_WIDTH, 3 );
 
endy5:

Hi,

I looking for answer at this situation. I have easy code, two or more object overlay with the same parameter, color is different.

In both cases I am always seeing on graph yellow line. Why I don´t  see once blue line and once yellow line?

Make one a background object . . . 
 
oh yes... ;-) it is solution... Thank you very mutch, RaptorUK!!! 
 

only such interesting...

I added row:   ObjectSet( <name object>,  OBJPROP_BACK, true );  

for both objects´ code, I tried to create first blue line then yellow line, yellow line then blue line and I always was on top yellow... it is little mystery MQL for me... :-)

 
endy5:

only such interesting...

I added row:   ObjectSet( <name object>,  OBJPROP_BACK, true );  

for both objects´ code, I tried to create first blue line then yellow line, yellow line then blue line and I always was on top yellow... it is little mystery MQL for me... :-)


The one you want to be at the back,  set it to background (OBJPROP_BACK = true)
 
In the MetaTrader 4 program the objects are displayed in alphabetical order. See Displaying of Support/Resistance Levels - MQL4 Articles
Reason: