Automated trading

 

 I was  hoping someone might help me

In the case whereby the (iHigh) and (iLow) in MQL4  finds  the  highest  or  the  lowest  price  of a single candle,

Is  there  a  way  or  function  i can  use  to find  a  common low  or  high  price   shared  by a  set  number  of  previous  candles  and  use  the  returned  values  to  draw  a line  that  might  be  used  for  example  to  draw  a  support  or  resistance  line? 

 

here is it : 


  
extern int                  LastBars=24;

  int slh=iHighest(NULL,0,MODE_HIGH,LastBars,1);
  int sll=iLowest(NULL,0,MODE_LOW,LastBars,1);
  double lh=iHigh(NULL,0,slh);
  double ll=iLow(NULL,0,sll);
  Comment("The Highest of Last ",LastBars," Bars is = ",lh,"\n",
  "The Lowest of Last ",LastBars," Bars is = ",ll);