How can i drow 6 horizontal line?

 

Hi

How can i drow 6 horizontal line?What codes?

for Support & Resistance on price.

This code just drow 1 line in last price.

   for(int j=1 ; j<6 ; j++)

    {

     ObjectCreate(0,"S&R",OBJ_HLINE,0,0,array[d]);

     ObjectSetInteger(0,"S&R",OBJPROP_COLOR,clrOrangeRed);

     ObjectSetInteger(0,"S&R",OBJPROP_STYLE,STYLE_DASH);

     ObjectSetString(0,"S&R",OBJPROP_TOOLTIP,"S&R");

     d--;

    }

 
Maryam:

Hi

How can i drow 6 horizontal line?What codes?

for Support & Resistance on price.

This code just drow 1 line in last price.

   for(int j=1 ; j<6 ; j++)

    {

     ObjectCreate(0,"S&R",OBJ_HLINE,0,0,array[d]);

     ObjectSetInteger(0,"S&R",OBJPROP_COLOR,clrOrangeRed);

     ObjectSetInteger(0,"S&R",OBJPROP_STYLE,STYLE_DASH);

     ObjectSetString(0,"S&R",OBJPROP_TOOLTIP,"S&R");

     d--;

    }

Please search before posting. Search for Object Create in forum for object creation, that way the result - hopefully - won't mix with Object Oriented Programming.

https://www.mql5.com/en/search#!keyword=ObjectCreate&method=2&module=mql5_module_forum 

and use SRC button to post your code https://www.mql5.com/en/articles/24#editor 

 

phi.nuts:

Please search before posting. Search for Object Create in forum for object creation, that way the result - hopefully - won't mix with Object Oriented Programming.

https://www.mql5.com/en/search#!keyword=ObjectCreate&method=2&module=mql5_module_forum 

Thnk for your help

Just yesterdey searching but was resultless.

 
Maryam:

Thnk for your help

Just yesterdey searching but was resultless.

Really ?, Please try harder next time - if you know what I mean there ;) 

Please read this carefully https://www.mql5.com/en/forum/3177, and example in here https://www.mql5.com/en/forum/6983#comment_214634

And please edit (move your cursor to bottom right) your code using SRC button, to show your appreciation for the help you get.

 

 

 

Articles do not help
Because only one line
Horizontal is drawn
I'm want drawing 6 lines
Horizontal on 6-point Indicator Zigzag
I am looking for another way
If someone could please help me

 
Maryam:

Articles do not help
Because only one line
Horizontal is drawn
I'm want drawing 6 lines
Horizontal on 6-point Indicator Zigzag
I am looking for another way
If someone could please help me

Al right, I fix your code but can you tell me what variable d in this code :

  string name; 
  for(int j=1 ; j<6 ; j++) 
    {
     StringConcatenate(name, "S&R ",j);
     ObjectCreate     (0,name ,OBJ_HLINE,0,0,array[d]);
     ObjectSetInteger (0,name ,OBJPROP_COLOR,clrOrangeRed);
     ObjectSetInteger (0,name ,OBJPROP_STYLE,STYLE_DASH);
     ObjectSetString  (0,name ,OBJPROP_TOOLTIP,name);
     d--;
    }

 And you still didn't edit your code using SRC button.

 
phi.nuts:

Really ?, Please try harder next time - if you know what I mean there ;) 

Please read this carefully https://www.mql5.com/en/forum/3177, and example in here https://www.mql5.com/en/forum/6983#comment_214634

And please edit (move your cursor to bottom right) your code using SRC button, to show your appreciation for the help you get.

 

 

Thank you
 
phi.nuts:

Al right, I fix your code but can you tell me what variable d in this code :

 

 

 


Definition variable d

int d=Bars(_Symbol,_Period)-2;

Thank you very much

The problem was solved by adding the line

StringConcatenate(name, "S&R ",j);



Reason: