array.includes() - Pine Script Function
array.includes()
Section titled “array.includes()”Overview
Section titled “Overview”The function returns true if the value was found in an array, false otherwise.
Syntax
Section titled “Syntax”array.includes(id, value) → series boolParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| id | any array type | An array object. |
Returns
Section titled “Returns”True if the value was found in the array, false otherwise.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("array.includes example")a = array.new_float(5,high)p = closeif array.includes(a, high) p := openplot(p)