Skip to content
Algo Trade Analytics Docs

array.new_string() - Pine Script Function

The function creates a new array object of string type elements.

array.new_string(size, initial_value) → array<string>
NameTypeDescription
sizeseries intInitial size of an array. Optional. The default is 0.

The ID of an array object which may be used in other array.*() functions.

  • An array index starts from 0.
//@version=6
indicator("array.new_string example")
length = 5a = array.new_string(length, "text")
label.new(bar_index, close, array.get(a, 0))