How to draw Line using ObjCreate() function from within Expert Advisor?

 

I am trying to draw bollinger band line from within Expert advisor using ObjCreate() function with OBJ_TREND type of object but it draws line that goes beyond two coordinated (Time1,PRice1) and (Time2, Price2). I would like to be line drawn only from first to second coordinate but line extend beyond. Can someone suggest me how to accomplish this?

Attaching the screen shot of lines that I am getting with OBJ_TREND.

I would appreciate if someone could suggest me to do this.


thanks,

Files:
lineDrawn.jpg  19 kb
 
Ashok Nale:

I am trying to draw bollinger band line from within Expert advisor using ObjCreate() function with OBJ_TREND type of object but it draws line that goes beyond two coordinated (Time1,PRice1) and (Time2, Price2). I would like to be line drawn only from first to second coordinate but line extend beyond. Can someone suggest me how to accomplish this?

Attaching the screen shot of lines that I am getting with OBJ_TREND.

I would appreciate if someone could suggest me to do this.


thanks,

I could use 

ObjectSetInteger(0,name,OBJPROP_RAY,false);

to draw line from one point to other.

Problem solved.