Downtrend

Calculates the Downtrend indicator.

Accepts the following parameters:

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

Returns: Series<Boolean>

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

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