How to perform an action based on trendline drawn on indicator window

 

I am trying to send a notification when an RSI crosses a trendline on the indicator window, how can I do this?

I am trying to test a strategy for a month from now. I want to draw a trend line manually on RSI Indicator window, then add a script or EA to alert me when RSI crosses/ touches that trendline.  

I know how to calculate RSI on mql4 and use "Alert" and "SendNotification" functions, but I don't want to draw a trend line from it because of precision issues. So, How can I create that alert after drawing a trendline manually?

Consider an image above, I need an alert when RSI(in blue) crosses/ touches trendline(in red).

I'll appreciate any help including a reference if a similar question was posted before.

Thank you.

 

Check ObjectGetValueByTime() and ObjectGetValueByShift() functions.

Use them to read trend line values at required time/bar.

ObjectGetValueByTime - Object Functions - MQL4 Reference
ObjectGetValueByTime - Object Functions - MQL4 Reference
  • docs.mql4.com
ObjectGetValueByTime - Object Functions - MQL4 Reference
Reason: