MQL5 - Conditional code to delete obj_hline

 

I have a script that creates multiple hlines and I need to delete the lines as long as they meet the following criteria:


1- Name "Line Support xx" and parameter is the value of the line;

Condition 1: Contains "Support Linexx" and Candle with opening price less than hline value and closing price greater than hline value;


If positive, delete the indicated hline


2- Name “Resistance Line xx” and the parameter is the value of the line;

Condition 2: Contains Resistance and Candle Line with opening price above hline value and closing price below hline value;

If positive, delete the indicated hline


xx = variable number

Reason: