Use a series to check if something happened within the last n bars

// buy if Signal1 crossed over Signal2 within the last 7 bars
...
vars crosses = series(0); // generate a series and set it to 0
if(crossOver(Signal1,Signal2)
crosses[0] = 1;// store the crossover in the series
if(Sum(crosses,7) > 0) // any crossover within last 7 bars?
enterLong();
...