how to detect a cross of a trendline?

 
Hi there,

I managed to draw a trendline on my chart (well, let my EA draw one of course :)). But now comes the thing I actually need to know: how can I find out when the price crosses the trendline I drew? For example: I connected the highs during the last 10 candles forming a resistance line. How can I know (the EA that is ...) when the price goes up and crosses that line?

Any suggestions are very appreciated!!!

Thanks in advance.

Greetingz,
Koen.
 
look here:

https://docs.mql4.com/objects/ObjectGetValueByShift

it gives a value of trendline at certain point in chart.