Sidechair

ta.falling()

Browse the reference

Returns true when source has fallen on each of the last length bars.

Try it in the editor

ta.falling tests source < source[1], source[1] < source[2], and so on for length steps. One flat or rising step makes it false.

It needs length + 1 values, so it is false on the first length bars and wherever an na enters the tested values.

Syntax

Pine Script
ta.falling(source: series int/float, length: series int) -> series bool

Arguments

NameTypeDefaultDescription
sourceseries int/floatrequiredThe series tested for a fall on each of the last length bars.
lengthseries intrequiredNumber of consecutive falls required. A whole number of 1 or more.

Returns

series bool: true when every one of the last length steps went down, otherwise false.

Remarks

  • Pair it with ta.rising to colour a series by short-term direction.

Example

Pine ScriptTwo falling lowsOpen in editor
//@version=6
indicator("Falling lows", overlay = true)
down2 = ta.falling(low, 2)
plotshape(down2, "Two down", shape.triangledown, location.abovebar, color.red, size = size.tiny)

See also

Runs on Sidechair