You can only have one object for a given name. Your code created the hLine on the oldest bar on the chart.
- Create different names,
- Move the line, or
- Use one in the codebase.
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!
it is broken:
it is broken:
You can only have one object for a given name. Your code created the hLine on the oldest bar on the chart.
- Create different names,
- Move the line, or
- Use one in the codebase.
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
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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