# How can I get TrendLine intermediate values?

For example, I want to connect any two points of the A/D indicator (my purpose is to detect divergence), but if there is a dip/top that exceeds the "trendline" between these two points, this drawing should not be accepted. Same goes for both prices.

What I am trying to do is to create a trendline between two points on the indicator and price and compare each price/indicator value with the trendline value.

How can I get the intermediate values of the Trendline as an array?

imgur.com
• imgur.com
Imgur: The magic of the Internet

ZiYaR1 How can I get the intermediate values of the Trendline as an array?

Perhaps you should read the manual. ObjectGetValueByTime
How To Ask Questions The Smart Way. (2004)
RTFM and STFW: How To Tell You've Seriously Screwed Up.

William Roeder #:

Perhaps you should read the manual. ObjectGetValueByTime
How To Ask Questions The Smart Way. (2004)
RTFM and STFW: How To Tell You've Seriously Screwed Up.

Thanks but I need to create a trendLine for this path. I was looking for a way without needing to create a TrendLine and I guess it doesn't exist.

ZiYaR1:
What I am trying to do is to create a trendline between two points on the indicator and price and compare each price/indicator value with the trendline value.

How can I get the intermediate values of the Trendline as an array?

ZiYaR1 #:

Thanks but I need to create a trendLine for this path. I was looking for a way without needing to create a TrendLine and I guess it doesn't exist.

Your requirement is not clear, are you creating or not creating? The function above, should be used with creating to getting the values and comparing, if the said condition is meet, without creating use equation of a line (Y=m(x)+C), to get the value and compare with price.

ZiYaR1 #: Thanks but I need to create a trendLine for this path. I was looking for a way without needing to create a TrendLine and I guess it doesn't exist.

Please read the following post ... Get Trendline price with calculation - How to get the price of a trendline?

Fernando Carreiro #:

Please read the following post ... Get Trendline price with calculation - How to get the price of a trendline?

Ok thanks. As a result, if we want to get values the object without creating it, there is no ready-made function. We have to calculate manually.

ZiYaR1 #: Ok thanks. As a result, if we want to get values the object without creating it, there is no ready-made function. We have to calculate manually.
Yes, that is correct! But now you can use my code as an example for your own code, or you can make your own function for future use.

Fernando Carreiro #:
Yes, that is correct! But now you can use my code as an example for your own code, or you can make your own function for future use.

That's exactly what I did. It worked for me, thanks. :)

ZiYaR1 #:That's exactly what I did. It worked for me, thanks. :)
You are welcome!