Returns the lowest value of source over the last length bars, including the current one.
ta.lowest scans the window of length values and returns the smallest. With a single argument, ta.lowest(length), the source is the bar low.
The window needs length bars before a value appears, and any na inside it returns na.
Syntax
ta.lowest(source: series int/float, length: series int) -> series floatArguments
| Name | Type | Default | Description |
|---|---|---|---|
| source | series int/ | required | Series to scan. Leave it out, passing only the length, to scan low. |
| length | series int | required | Number of bars in the window. A whole number of 1 or more. |
Returns
series float: the smallest value in the window, or na while it is not full.
Remarks
- To place a stop under recent lows, use
ta.lowest(low, n)[1] so the current bar is not part of its own stop.
Example
//@version=6
indicator("Lowest close", overlay = true)
low20 = ta.lowest(close, 20)
plot(low20, "20-bar low close", color = color.red)
plotshape(close == low20, "New low", shape.xcross, location.belowbar, color.red, size = size.tiny)See also
Runs on Sidechair