Skip to content
AlertaChartAlertaScript / docs
AlertaScript / alerta.request.currency_rate
On this pageSignatureParametersReturnsExampleNotes

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 float

Parameters

NameTypeRequiredDefaultDescription
fromsimple stringYes—Source currency code (e.g. currency.USD).
tosimple stringYes—Target currency code.
ignore_invalid_currencyboolNot specified—Pine v6: return na instead of raising when the pair has no rate.

Returns

series float

Example

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.

AlertaScript

No results found.

Search by name, alias, or keyword.