33 constexpr std::array<std::string_view,
36 "EURINR",
"GBPINR",
"AUDUSD",
"USDMXN"};
45 return std::string(
symbol_names[
static_cast<size_t>(symbol)]);
58 throw std::invalid_argument(
"Unknown symbol name");
Definition Instrument.h:11
Instrument from_string(std::string_view name)
Converts a string to its corresponding Instrument enum.
Definition Instrument.h:54
Instrument
Represents the financial instruments available for trading.
Definition Instrument.h:17
@ AUDUSD
Australian Dollar / US Dollar.
@ EURINR
Euro / Indian Rupee.
@ GBPUSD
British Pound / US Dollar.
@ USDMXN
US Dollar / Mexican Peso.
@ COUNT
Helper to get the number of instruments.
@ USDINR
US Dollar / Indian Rupee.
@ GBPINR
British Pound / Indian Rupee.
@ EURUSD
Euro / US Dollar.
@ USDCAD
US Dollar / Canadian Dollar.
@ USDJPY
US Dollar / Japanese Yen.
std::string to_string(Instrument symbol)
Converts an Instrument enum to its string representation.
Definition Instrument.h:43
constexpr std::array< std::string_view, static_cast< size_t >(Instrument::COUNT)> symbol_names
An array of string representations for the Instrument enum.
Definition Instrument.h:35