Sidechair

ta.rising()

Browse the reference

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

Try it in the editor

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

It needs length + 1 values, so it is false on the first length bars.

Syntax

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

Arguments

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

Returns

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

Remarks

  • An na anywhere in the tested values gives false.

Example

Pine ScriptThree rising closesOpen in editor
//@version=6
indicator("Rising closes", overlay = true)
up3 = ta.rising(close, 3)
plotshape(up3, "Three up", shape.circle, location.belowbar, color.green, size = size.tiny)
bgcolor(up3 ? color.new(color.green, 90) : na)

See also

Runs on Sidechair