Zorder Function

 
Hello
 I am trying to make an interactive line over an already presented 2 other lines. so I can drag it through chart

if (ObjectFind(interactive_line_name) == -1) {
        ObjectCreate(interactive_line_name, OBJ_HLINE, 0, Time[0], Ask);
        ObjectSet(interactive_line_name, OBJPROP_COLOR, DarkKhaki);
        ObjectSet(interactive_line_name, OBJPROP_STYLE, STYLE_SOLID);
        ObjectSet(interactive_line_name, OBJPROP_WIDTH, black_line_thickness);  // Set the thickness of the black line
        ObjectSetInteger(0, interactive_line_name, OBJPROP_ZORDER, 0);  // Ensure black line is on top,

Where all other objects 

OBJPROP_ZORDER, -1);
Still the other 2 lines are on top though? Could changing its name give priority to be on top
So I have to manually drag them and put them any place on chart in order I can reach the interactive line.

 
Please help

 

In MQL ZOrder usage is NOT to draw objects on top of others, but to set which one will receive mouse events.

Documentation :

"Priority of a graphical object for receiving events of clicking on a chart (CHARTEVENT_CLICK). The default zero value is set when creating an object; the priority can be increased if necessary. When objects are placed one atop another, only one of them with the highest priority will receive the CHARTEVENT_CLICK event."
Documentation on MQL5: Constants, Enumerations and Structures / Chart Constants / Types of Chart Events
Documentation on MQL5: Constants, Enumerations and Structures / Chart Constants / Types of Chart Events
  • www.mql5.com
There are 11 types of events that can be processed using the predefined function OnChartEvent() . For custom events 65535 identifiers are provided...
 
Create objects in required order from very beginning or hide/show (or delete/recreate) some of them to redraw above other ones.
 
Alain Verleyen #:

In MQL ZOrder usage is NOT to draw objects on top of others, but to set which one will receive mouse events.

Documentation :

Thank You for your reply. so how to set the priority for the interactive line I already tried make them higher value than the other. ,my intention is not to draw lines over each other, it 's already an object in the original indicator and I wanted to make it an interactive so original lines if i delete it it will screw the indicator, since it does not bother me to be over each other I went with this solution but it is annoying i had to double click with mouse pointer to choose the line when it's underneath the other 2 even if priority was set to be selected by mouse pointer first. So if zorder is about the priority to mouse pointer this would be working perfect form because All i want the line to be firstly picked (prioritized) over the other 2 lines..which has not been occured.

 
Stanislav Korotky #:
Create objects in required order from very beginning or hide/show (or delete/recreate) some of them to redraw above other ones.

Thank you for your reply. I tried to do that but I am not a coder so I have very limited knowledge. the indicator would not compile. I thought It was a simple thing as to change 0 in this line to 1,2,3 I kept playing with it but never change the sensitivity to muse pointer   ObjectSetInteger(0, interactive_line_name, OBJPROP_ZORDER, 0) 

.