Skip to content
Algo Trade Analytics Docs

request.currency_rate() - Pine Script Function

Provides a daily rate that can be used to convert a value expressed in the from currency to another in the to currency.

request.currency_rate(from, to, ignore_invalid_currency) → series float
NameTypeDescription
fromseries stringThe currency in which the value to be converted is expressed. Possible values: a three-letter string with the currency code in the ISO 4217 format (e.g. “USD”)
orone of the built-in variables that return currency codes
likesyminfo.currency or currency.USD.
  • If from and to arguments are equal, function returns 1. Please note that using this variable/function can cause indicator repainting.
//@version=6
indicator("Close in British Pounds")
rate = request.currency_rate(syminfo.currency, "GBP")
plot(close * rate)