How can I get TrendLine intermediate values?

ZiYaR1  
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?


https://imgur.com/Xij0rpt

imgur.com
  • imgur.com
Imgur: The magic of the Internet
Thank-god Avwerosuoghene Odukudu  
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.

Fernando Carreiro  
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.
ZiYaR1  
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. :)

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