calculating lenght of a horizintal line (t2 - t1 )

 

hi there


i need a code that calculates a lines length ( t2 - t1 ) and if it is bigger that t1 then alert ( t1 = time of first candle   , t2 = time of second candle )

my indicator draws it in every candle but it may fail due to some calculations and wont continue to next candle but next candle also has that line and does some calculations

when second candle starts to form i want to check if line continues from from first candle and exists also in second candle

so i need to make sure the line length is bigger than 1 candle

any help ?