Skip to content
Algo Trade Analytics Docs

str.repeat() - Pine Script Function

Constructs a new string containing the source string repeated repeat times with the separator injected between each repeated instance.

str.repeat(source, repeat, separator) → const string
NameTypeDescription
sourceconst stringString to repeat.
  • Returns na if the source is na.
//@version=6
indicator("str.repeat")
repeat = str.repeat("?", 3, ",") // Returns "?,?,?"
label.new(bar_index,close,repeat)