OBJ_HLINE not ray mode?

 

hi guys,

 

i wrote little code to draw a Daily High & Low however it always be ray mode so after few days there will be too many lines! and make chart unreadable -_-

 

wondering if there is a way to make the Horizontal line not ray and only appear between Daily  Separator not continue  to others with this ray effect?!

Thank you 

 

 ObjectCreate("DailyHIGH", OBJ_HLINE,0,0, iHigh(Symbol(),PERIOD_D1,0), 0, clrAqua); // Daily High
 
 ObjectSet("DailyHIGH", OBJPROP_RAY,False); // this line DOESNT WORK!
  ObjectSet("DailyHIGH",OBJPROP_STYLE,STYLE_SOLID);// Style of line
 ObjectSet("DailyHIGH",OBJPROP_COLOR,clrCrimson); // Color of Line
 
 ObjectCreate("DailyLOW", OBJ_HLINE, 0, 0, iLow(Symbol(),PERIOD_D1,0), 0, clrAqua); // Daily LOW
 ObjectSet("DailyLOW",OBJPROP_STYLE,STYLE_SOLID); // Style of line
 ObjectSet("DailyLOW",OBJPROP_COLOR,clrBlue);// Color of Line
 
 

You are using an inappropriate Chart Object type and the function ObjectCreate() incorrectly.

ObjectCreate("DailyHIGH", OBJ_HLINE,0,0, iHigh(Symbol(),PERIOD_D1,0), 0, clrAqua); // Daily High
ObjectSet("DailyHIGH", OBJPROP_RAY,False); // this line DOESNT WORK!
  1. Horizontal lines (OBJ_HLINE) always span the full breadth of the chart (to left and to the right) and only has one anchor point (price but with time value ignored). If you want to have a line with a start and end points, use OBJ_TREND instead.
  2. The anchor positions are always expressed in pairs (even number of parameters).
  3. There is no colour parameter for ObjectCreate().
  4. OBJPROP_RAY property has no effect on Horizontal lines (OBJ_HLINE). Use it with the OBJ_TREND instead.
 
FMIC:

You are using an inappropriate Chart Object type and the function ObjectCreate() incorrectly

Thank you.

yeah after so many try findout that wish there were better helpfile for mql every single bit of information in helpfile is confusing 

 

anyway thank you, i will try to make it work with trend line

Reason: