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

Reference data for one instrument. More...

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

Collaboration diagram for algotradelib::Instrument:

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, which selects the price grid.
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; kind UNKNOWN where the library has no table.

Detailed Description

Reference data for one instrument.

Fields a broker may omit are optional or empty. price_rule_ is the library's grid, chosen by price_rule_for from the security type.

Definition at line 474 of file instrument.hpp.

Member Function Documentation

◆ dates_exclude()

DateExclusion algotradelib::Instrument::dates_exclude ( Date day) const
inline

Tests whether the listing and delisting dates rule a day out.

Parameters
dayThe day.
Returns
EXCLUDED if a readable date rules day out (listed after it, or delisted on or before it); otherwise UNREADABLE if either date is unreadable; otherwise NOT_EXCLUDED.
Note
NOT_EXCLUDED does not mean the instrument trades on day; check status_ too.

Definition at line 516 of file instrument.hpp.

Member Data Documentation

◆ common_share_

bool algotradelib::Instrument::common_share_ {true}

Whether this is the common share, not a preferred or derived line.

Definition at line 492 of file instrument.hpp.

◆ currency_

Currency algotradelib::Instrument::currency_

The currency it trades in.

Definition at line 490 of file instrument.hpp.

Referenced by algotradelib::strategy::weight_target().

◆ delisted_on_

StatedDate algotradelib::Instrument::delisted_on_

The delisting date; always NOT_STATED from Kiwoom, which publishes none.

Definition at line 500 of file instrument.hpp.

Referenced by dates_exclude().

◆ english_name_

std::string algotradelib::Instrument::english_name_

The English name, or empty.

Definition at line 480 of file instrument.hpp.

◆ id_

InstrumentId algotradelib::Instrument::id_

The instrument.

Definition at line 476 of file instrument.hpp.

Referenced by algotradelib::runner::Context< BrokerTag, CapsType >::set_instrument().

◆ isin_

std::string algotradelib::Instrument::isin_

The ISIN, or empty.

Definition at line 482 of file instrument.hpp.

◆ listed_on_

StatedDate algotradelib::Instrument::listed_on_

The listing date.

Toss sends null for none; KIS sends "" (and probably "00000000"); Kiwoom sends "".

Definition at line 498 of file instrument.hpp.

Referenced by dates_exclude().

◆ lot_size_

std::optional<Decimal64> algotradelib::Instrument::lot_size_

The order quantity increment, if the broker publishes one.

Definition at line 504 of file instrument.hpp.

◆ name_

std::string algotradelib::Instrument::name_

The local-language name, as the broker spells it.

Definition at line 478 of file instrument.hpp.

◆ price_rule_

PriceRule algotradelib::Instrument::price_rule_

The price grid; kind UNKNOWN where the library has no table.

Definition at line 506 of file instrument.hpp.

Referenced by algotradelib::strategy::reconcile(), and algotradelib::strategy::reconcile().

◆ segment_

MarketSegment algotradelib::Instrument::segment_

The market segment.

Definition at line 484 of file instrument.hpp.

◆ shares_outstanding_

std::optional<Decimal64> algotradelib::Instrument::shares_outstanding_

Shares outstanding, if published; KIS's blank or zero is empty, never zero shares.

Definition at line 502 of file instrument.hpp.

◆ status_

InstrumentStatus algotradelib::Instrument::status_ {InstrumentStatus::UNKNOWN}

Listed, awaiting listing, or delisted.

Definition at line 488 of file instrument.hpp.

◆ type_

SecurityType algotradelib::Instrument::type_ {SecurityType::UNKNOWN}

The kind of security, which selects the price grid.

Definition at line 486 of file instrument.hpp.


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