Getting the value of User drawn trend line

 
I am trying to get the value of a trend line drawn by the user on the chart.  Any ideas?  I can't figure out a proper way to draw a trend line since there is so much personal intuition on what a pivot point would be considered.  Is there a way to get the value of the trend line so I can use it to code an ea to automatically trade when parameters have been met?  Or do I have to find a way to define anchor points for a trend line.   I'm also open to ideas on that as well.
 
Mikeel1987: I am trying to get the value of a trend line drawn by the user on the chart. 

A trend line does not have a value. It has continuous prices from start to end. Until you can state what you want in concrete terms, it can not be coded.
ObjectGetValueByTime

 
William Roeder #:

A trend line does not have a value. It has continuous prices from start to end. Until you can state what you want in concrete terms, it can not be coded.
ObjectGetValueByTime

I can get the value of a trend line that I have an EA create by using OjectGetValueByShift.  Is there any way to be able to get the same kind of value with user drawn trend line?

 
you can ask user to rename their line to a specific name then find it uing ObjectFind()
 
Mikeel1987 #:

I can get the value of a trend line that I have an EA create by using OjectGetValueByShift.  Is there any way to be able to get the same kind of value with user drawn trend line?

Yes, there is, the difficult part is actually identifying the Trendline you want to read.

You can use chart events to see if a new object has been created, you will get the name of the newly created object as a parameter to OnChartEvent.

But, this event also gets raised when an EA is creating a new object, so it might be difficult to actually identify a user created object.

The terminal has a scheme on how it names objects, but I would not count on that, because the user can name it what they want, and an EA can replicate the terminal scheme for object names. So it is not exactly very reliable to build on that.

So if any program is also drawing onto the chart, you will be reading that object as well, if the program has not disabled notifications for creating/modifying/deleting objects. Also be aware, if your own program changes objects, it might be notified as well, ending up in an infinite loop in that case.