Replacing fractals indicator arrows with HLine ?

 

Hey, Is it possible to replace the arrows on Fractals indicator to horizontal lines ? I've inserted the following code within the IF statement for plotting the high arrows:

 ObjectCreate("HLine", OBJ_HLINE,0,0, dCurrent);

           ObjectSet("HLine", OBJPROP_STYLE, STYLE_SOLID);

           ObjectSet("HLine", OBJPROP_COLOR, Green);

           ObjectSet("HLine", OBJPROP_WIDTH, 2);

Where dCurrent is High[i] and the plot for the arrow. Shouldn't this then continue to draw the arrow but also a horizontal line over the top of it ? Ive altered dCurrent in ObjectCreate to High[1] and it plots a line in the correct place but nothing appears when i use the code above?

Any Pointers ?

Thanks in advance 

 

You can only have one object for a given name. Your code created the hLine on the oldest bar on the chart.

  1. Create different names,
  2. Move the line, or
  3. Use one in the codebase.
 
torexvir:

Hey, Is it possible to replace the arrows on Fractals indicator to horizontal lines ? I've inserted the following code within the IF statement for plotting the high arrows:

 ObjectCreate("HLine", OBJ_HLINE,0,0, dCurrent);

           ObjectSet("HLine", OBJPROP_STYLE, STYLE_SOLID);

           ObjectSet("HLine", OBJPROP_COLOR, Green);

           ObjectSet("HLine", OBJPROP_WIDTH, 2);

Where dCurrent is High[i] and the plot for the arrow. Shouldn't this then continue to draw the arrow but also a horizontal line over the top of it ? Ive altered dCurrent in ObjectCreate to High[1] and it plots a line in the correct place but nothing appears when i use the code above?

Any Pointers ?

Thanks in advance 

Hello,

Why change it if code isn't broken!

 
GrumpyDuckMan: Why change it if code isn't broken!

it is broken:

torexvir: but nothing appears when i use the code above
 
whroeder1:

it is broken:

whroeder1:

You can only have one object for a given name. Your code created the hLine on the oldest bar on the chart.

  1. Create different names,
  2. Move the line, or
  3. Use one in the codebase.
GrumpyDuckMan:

Hello,

Why change it if code isn't broken!

Thanks for the replies. Yea i thought that was the issue. I normally build my own scripts on pine in TradingView which is obviously very easy to do. However building stuff for MT4 is a whole other ball game. Basically, i am ultimately looking for Hline to be plotted on the high of the fractal and then be destroyed if price breaks the line further down the line. You can't use a hline function in Pine which is why I'm here. 

I've found others asking similar questions throughout the forum but it never seems to result in an answer or functioning script