Skip to content

Currencies

QuantConnect.Currencies

Bases: Object

Provides commonly used currency pairs and symbols

USD

USD: str = 'USD'

USD (United States Dollar) currency string

EUR

EUR: str = 'EUR'

EUR (Euro) currency string

GBP

GBP: str = 'GBP'

GBP (British pound sterling) currency string

INR

INR: str = 'INR'

INR (Indian rupee) currency string

IDR

IDR: str = 'IDR'

IDR (Indonesian rupiah) currency string

CNH

CNH: str = 'CNH'

CNH (Chinese Yuan Renminbi) currency string

CHF

CHF: str = 'CHF'

CHF (Swiss Franc) currency string

HKD

HKD: str = 'HKD'

HKD (Hong Kong dollar) currency string

JPY

JPY: str = 'JPY'

JPY (Japanese yen) currency string

NULL_CURRENCY

NULL_CURRENCY: str = 'QCC'

Null currency used when a real one is not required

CURRENCY_SYMBOLS

CURRENCY_SYMBOLS: IReadOnlyDictionary[str, str] = ...

A mapping of currency codes to their display symbols

STABLE_PAIRS_GDAX

STABLE_PAIRS_GDAX: HashSet[str] = ...

Stable pairs in GDAX. We defined them because they have different fees in GDAX market

StablePairsGDAX is deprecated. Use StablePairsCoinbase instead.

STABLE_PAIRS_COINBASE

STABLE_PAIRS_COINBASE: HashSet[str] = ...

Stable pairs in Coinbase. We defined them because they have different fees in Coinbase market

get_currency_symbol

get_currency_symbol(currency: str) -> str

Gets the currency symbol for the specified currency code

Parameters:

Name Type Description Default
currency str

The currency code

required

Returns:

Type Description
str

The currency symbol.

is_stable_coin_without_pair

is_stable_coin_without_pair(
    symbol: str, market: str
) -> bool

Checks whether or not certain symbol is a StableCoin without pair in a given market

Parameters:

Name Type Description Default
symbol str

The Symbol from wich we want to know if it's a StableCoin without pair

required
market str

The market in which we want to search for that StableCoin

required

Returns:

Type Description
bool

True if the given symbol is a StableCoin without pair in the given market.

parse

parse(value: str) -> float

Converts the string representation of number with currency in the format {currency}{value} to its decimal equivalent. It throws if the value cannot be converted to a decimal number.

Parameters:

Name Type Description Default
value str

The value with currency

required

Returns:

Type Description
float

The decimal equivalent to the value.

try_parse

try_parse(
    value: str, parsed_value: Optional[float]
) -> Tuple[bool, float]

Converts the string representation of number with currency in the format {currency}{value} to its decimal equivalent.

Parameters:

Name Type Description Default
value str

The value with currency

required
parsed_value Optional[float]

The decimal equivalent to the string value after conversion

required

Returns:

Type Description
Tuple[bool, float]

True if the value was succesfuly converted.