Trend line to the right boarder

 

Hi

This code needs to create a trend line and extend it to the right chart boarder regardless of the shift button action. it works but not an elegant solution, Any suggestions?  Thanks


  datetime start = TimeCurrent();
  datetime end = start + 2000000;
  ObjectCreate(0, dayPivotLineName, OBJ_TREND, 0, start, APrice, end, BPrice);
 
samjesse:

Hi

This code needs to create a trend line and extend it to the right chart boarder regardless of the shift button action. it works but not an elegant solution, Any suggestions?  Thanks


Is there a particular reason that you need it to end at the right border?

If not just use Ray

ObjectSetInteger(0,dayPivotLineName,OBJPROP_RAY,true);