When I set trendPeriod = 1, It says below.

Error 011: Function EMA called with invalid data.

Why this considered invalid?