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 boolParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
source | series string | Yes | — | Source string. |
target | series string | Yes | — | String to search for. |
Returns
series boolExample
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.