algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::InstrumentId Struct Reference

Identifies an instrument: its country, venue and symbol. More...

#include <algotradelib/src/core/types.hpp>

Public Attributes

Country country_ {Country::KR}
 The listing country, which selects the symbol convention and the price grid.
Venue venue_ {Venue::COMBINED}
 The venue that is part of the identity (two venues are two instruments).
std::string symbol_
 The symbol as the venue spells it, such as "005930".

Friends

bool operator== (const InstrumentId &lhs, const InstrumentId &rhs)
 Compares country, venue and symbol.
bool operator< (const InstrumentId &lhs, const InstrumentId &rhs)
 Orders identities by country, venue, then symbol, so they can key a map.

Detailed Description

Identifies an instrument: its country, venue and symbol.

Definition at line 78 of file types.hpp.

◆ operator<

bool operator< ( const InstrumentId & lhs,
const InstrumentId & rhs )
friend

Orders identities by country, venue, then symbol, so they can key a map.

The order has no meaning beyond that, and it is consistent with operator==.

Parameters
lhsThe first identity.
rhsThe second identity.
Returns
true if lhs sorts before rhs.

Definition at line 109 of file types.hpp.

◆ operator==

bool operator== ( const InstrumentId & lhs,
const InstrumentId & rhs )
friend

Compares country, venue and symbol.

Parameters
lhsThe first identity.
rhsThe second identity.
Returns
true if all three are equal.

Definition at line 96 of file types.hpp.

Member Data Documentation

◆ country_

Country algotradelib::InstrumentId::country_ {Country::KR}

The listing country, which selects the symbol convention and the price grid.

Definition at line 80 of file types.hpp.

Referenced by algotradelib::backtest::NextBarFillModel::decide(), algotradelib::runner::journal_entry_to_line(), operator<, and operator==.

◆ symbol_

std::string algotradelib::InstrumentId::symbol_

The symbol as the venue spells it, such as "005930".

Definition at line 88 of file types.hpp.

Referenced by algotradelib::runner::journal_entry_to_line(), operator<, and operator==.

◆ venue_

Venue algotradelib::InstrumentId::venue_ {Venue::COMBINED}

The venue that is part of the identity (two venues are two instruments).

Where an order is routed is OrderRequest::venue_, not this.

Definition at line 86 of file types.hpp.

Referenced by algotradelib::runner::journal_entry_to_line(), operator<, and operator==.


The documentation for this struct was generated from the following file: