Doesn't the dominantPeriod function take the most dominant cycle period of the past x bars?

That is, it deals with this issue?