Data requests / Reference
alerta.request.currency_rate
TradingView-compatible spelling: request.currency_rate, runs without warnings
Pine v6: the daily rate that converts `from` into `to`, from AlertaChart's own feeds — two fiat currencies read the forex pair (a pair carried only the other way round, e.g. USD→EUR from EURUSD, is inverted), a coin against the dollar reads its USDT pair (and the inverse for USD→coin). Identical currencies (and USD/USDT/USDC) are exactly 1.0; any other combination returns na with a warning.
alerta.request.currency_rate(from, to, ignore_invalid_currency) → series floatParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
from | simple string | Yes | — | Source currency code (e.g. currency.USD). |
to | simple string | Yes | — | Target currency code. |
ignore_invalid_currency | bool | Not specified | — | Pine v6: return na instead of raising when the pair has no rate. |
Returns
series floatExample
alerta.request.currency_rate
indicator("EUR close", overlay=false)rate = request.currency_rate(currency.USD, currency.EUR)plot(close * rate, "Close in EUR")Notes
- Requires the requested currency-rate data; unavailable rates return na.
Names and aliases
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.