Skip to content
AlertaChartAlertaScript / docs
AlertaScript / alerta.str.contains
On this pageSignatureParametersReturnsExample

Utilities / Reference

alerta.str.contains

TradingView-compatible spelling: str.contains, runs without warnings

Returns true if the source string contains the target string.

alerta.str.contains(source, target) → series bool

Parameters

NameTypeRequiredDefaultDescription
sourceseries stringYes—Source string.
targetseries stringYes—String to search for.

Returns

series bool

Example

alerta.str.contains
indicator("String Contains Example")// Check if current asset is Bitcoin basedconst hasBTC = str.contains(syminfo.tickerid, "BTC")if hasBTC and barstate.islast    label.new(bar_index, high, "This is a Bitcoin pair!")

Names and aliases

Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.

AlertaScript

No results found.

Search by name, alias, or keyword.