Uptrend

Calculates the Uptrend indicator.

Accepts the following parameters:

Parameter NameTypeDefault ValueNotes
applyToSeries<Number>
close
-
averagingPeriodNumber10-
trendPeriodNumber3-

Returns: Series<Boolean>

Uptrend is a built-in function - you can use it directly. Below is an example implementation:

12
function Uptrend(applyTo = close, averagingPeriod = 10, trendPeriod = 3):
Consecutive(SMA(applyTo, Math.Floor(averagingPeriod / 2)) > SMA(applyTo, averagingPeriod)) >= trendPeriod