![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
Reference data for one instrument. More...
#include <algotradelib/src/core/instrument.hpp>
Public Member Functions | |
| DateExclusion | dates_exclude (Date day) const |
| Tests whether the listing and delisting dates rule a day out. | |
Public Attributes | |
| InstrumentId | id_ |
| The instrument. | |
| std::string | name_ |
| The local-language name, as the broker spells it. | |
| std::string | english_name_ |
| The English name, or empty. | |
| std::string | isin_ |
| The ISIN, or empty. | |
| MarketSegment | segment_ |
| The market segment. | |
| SecurityType | type_ {SecurityType::UNKNOWN} |
| The kind of security. | |
| InstrumentStatus | status_ {InstrumentStatus::UNKNOWN} |
| Listed, awaiting listing, or delisted. | |
| Currency | currency_ |
| The currency it trades in. | |
| bool | common_share_ {true} |
| Whether this is the common share, not a preferred or derived line. | |
| StatedDate | listed_on_ |
| The listing date. | |
| StatedDate | delisted_on_ |
| The delisting date; always NOT_STATED from Kiwoom, which publishes none. | |
| std::optional< Decimal64 > | shares_outstanding_ |
| Shares outstanding, if published; KIS's blank or zero is empty, never zero shares. | |
| std::optional< Decimal64 > | lot_size_ |
| The order quantity increment, if the broker publishes one. | |
| PriceRule | price_rule_ |
| The price grid, set by the adapter or the caller; kind UNKNOWN where it has no table. | |
Reference data for one instrument.
Fields a broker may omit are optional or empty. price_rule_ is set by the adapter that read the instrument, or by the caller who builds the reference data, and is UNKNOWN where it has no table.
Definition at line 420 of file instrument.hpp.
|
inline |
Tests whether the listing and delisting dates rule a day out.
| day | The day. |
Definition at line 462 of file instrument.hpp.
| bool algotradelib::Instrument::common_share_ {true} |
Whether this is the common share, not a preferred or derived line.
Definition at line 438 of file instrument.hpp.
| Currency algotradelib::Instrument::currency_ |
The currency it trades in.
Definition at line 436 of file instrument.hpp.
Referenced by algotradelib::alpaca::AlpacaBlockingClient::instrument(), and algotradelib::strategy::weight_target().
| StatedDate algotradelib::Instrument::delisted_on_ |
The delisting date; always NOT_STATED from Kiwoom, which publishes none.
Definition at line 446 of file instrument.hpp.
Referenced by dates_exclude().
| std::string algotradelib::Instrument::english_name_ |
The English name, or empty.
Definition at line 426 of file instrument.hpp.
Referenced by algotradelib::alpaca::AlpacaBlockingClient::instrument().
| InstrumentId algotradelib::Instrument::id_ |
The instrument.
Definition at line 422 of file instrument.hpp.
Referenced by algotradelib::alpaca::AlpacaBlockingClient::instrument(), and algotradelib::runner::Context< BrokerTag, CapsType >::set_instrument().
| std::string algotradelib::Instrument::isin_ |
The ISIN, or empty.
Definition at line 428 of file instrument.hpp.
| StatedDate algotradelib::Instrument::listed_on_ |
The listing date.
Toss sends null for none; KIS sends "" (and probably "00000000"); Kiwoom sends "".
Definition at line 444 of file instrument.hpp.
Referenced by dates_exclude().
| std::optional<Decimal64> algotradelib::Instrument::lot_size_ |
The order quantity increment, if the broker publishes one.
Definition at line 450 of file instrument.hpp.
Referenced by algotradelib::alpaca::AlpacaBlockingClient::instrument().
| std::string algotradelib::Instrument::name_ |
The local-language name, as the broker spells it.
Definition at line 424 of file instrument.hpp.
Referenced by algotradelib::alpaca::AlpacaBlockingClient::instrument().
| PriceRule algotradelib::Instrument::price_rule_ |
The price grid, set by the adapter or the caller; kind UNKNOWN where it has no table.
Definition at line 452 of file instrument.hpp.
Referenced by algotradelib::alpaca::AlpacaBlockingClient::instrument(), algotradelib::strategy::reconcile(), and algotradelib::strategy::reconcile().
| MarketSegment algotradelib::Instrument::segment_ |
The market segment.
Definition at line 430 of file instrument.hpp.
Referenced by algotradelib::alpaca::AlpacaBlockingClient::instrument().
| std::optional<Decimal64> algotradelib::Instrument::shares_outstanding_ |
Shares outstanding, if published; KIS's blank or zero is empty, never zero shares.
Definition at line 448 of file instrument.hpp.
| InstrumentStatus algotradelib::Instrument::status_ {InstrumentStatus::UNKNOWN} |
Listed, awaiting listing, or delisted.
Definition at line 434 of file instrument.hpp.
Referenced by algotradelib::alpaca::AlpacaBlockingClient::instrument().
| SecurityType algotradelib::Instrument::type_ {SecurityType::UNKNOWN} |
The kind of security.
Definition at line 432 of file instrument.hpp.