double bottom and double top

 

can anybody give me a code example for how to caculate when there is a lower than previous low or double bottom ? i looked in code base but cant find an indicator for example. here is what i learn from ilowest function but dont know is it right.

double prelow = ilowest(symbol(),0,mode_low,20,1);
double currentlow = ilowest(symbol(),0,mode_low,20,0);
if ( currentlow < prelow)
// start rules
Reason: