I don't see in the code how this makes sure it's been at least 3 bars.

This is the code from the workshop that was referenced:
function run()
{
vars Price = series(price());
vars Trend = series(LowPass(Price,500));

Stop = 4*ATR(100);
if(valley(Trend))
enterLong();
else if(peak(Trend))
enterShort();
}


It doesn't appear that lite-C or Zorro has a function for "bars since" something has occurred. How do we handle this situation?
There are many situations when you would want to test waiting at least one or two bars since some event has occurred.