Download MetaTrader 5

How can i drow 6 horizontal line?

To add comments, please log in or register
Make screenshots in MetaTrader and manage them in the gallery!
Maryam
78
Maryam 2012.11.06 06:17 

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--;

    }

phi nuts
2184
phi nuts 2012.11.06 07:34  
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 

Maryam
78
Maryam 2012.11.06 07:43  

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.

phi nuts
2184
phi nuts 2012.11.06 08:14  
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.

 

 

Maryam
78
Maryam 2012.11.07 07:24  

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

phi nuts
2184
phi nuts 2012.11.07 07:45  
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.

Maryam
78
Maryam 2012.11.07 07:46  
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
Maryam
78
Maryam 2012.11.07 07:56  
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);



To add comments, please log in or register