That is not the problem here, but a series must have a fixed number of elements. It can not change its number of elements from call to call, as you do with the series to HTTrendMode.

"Sensibility" means the bar period on which the DominantPhase function is most sensible. F.I when you only want to consider bar periods greater than 30 bars, give 40 or 50 here to make DominantPhase insensible for smaller bar periods.

I don't know in detail what HTTrendmode does, as we did not program this function. But I suppose you normally want to know the trend of the price, so you give a price series here.