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

The library: broker-neutral types (core), and the modules below. More...

Namespaces

namespace  analytics
 Returns, rolling statistics, indicators and performance metrics over numeric series.
namespace  backtest
 Replays a strategy over stored bars: fill and cost models, the replay ledger, and the report.
namespace  conformance
 The compile-time check behind ATL_ASSERT_BROKER(Client).
namespace  data_only
 Placeholder types and the refusal used by DataOnlyTraits.
namespace  kis
 The Korea Investment & Securities (KIS) Open API client.
namespace  kiwoom
 The Kiwoom Securities REST API client.
namespace  live
 Connects a runner to a broker session for live trading.
namespace  math
 The numeric vocabulary: Scalar, missing(), and the matrix and vector types.
namespace  network
 HTTP and WebSocket transport, OAuth tokens, and request pacing.
namespace  runner
 Runs a strategy: the runner, the polling loop, the order journal, and stopping.
namespace  strategy
 What a strategy sees and emits: events, intents, the portfolio, reconciliation and risk limits.
namespace  tossinvest
 The Toss Securities Open API client.

Classes

struct  AccountInfo
 One account from a broker's account list. More...
struct  AmendInstruction
 A modification or cancellation of a working order. More...
struct  Bar
 One bar: the prices and volume of one period, as exact decimals. More...
struct  BarQuery
 What bars to fetch. More...
struct  BarSeries
 The bars of one instrument and interval, oldest first. More...
class  BlockingSession
 A blocking broker client bound to one account, with the same broker operations as BrokerSession, plus accounts(). More...
struct  BrokerCaps
 What one broker client implements, as compile-time constants. More...
struct  BrokerError
 The error a broker or transport operation returns. More...
class  BrokerSession
 An asynchronous broker client bound to one account, with broker-neutral operations. More...
struct  BrokerTraits
 Describes one broker client to the library: its types, capabilities, call thunks and normalizers. More...
struct  BrokerTraits< kis::KisBlockingClient >
 The BlockingSession adapter for kis::KisBlockingClient. More...
struct  BrokerTraits< kis::KisClient >
 The BrokerSession adapter for kis::KisClient. More...
struct  BrokerTraits< kiwoom::KiwoomBlockingClient >
 The BlockingSession adapter for kiwoom::KiwoomBlockingClient. More...
struct  BrokerTraits< kiwoom::KiwoomClient >
 The BrokerSession adapter for kiwoom::KiwoomClient. More...
struct  BrokerTraits< tossinvest::TossBlockingClient >
 The BlockingSession adapter for tossinvest::TossBlockingClient. More...
struct  BrokerTraits< tossinvest::TossClient >
 The BrokerSession adapter for tossinvest::TossClient. More...
struct  BuyingPower
 What the broker says may be spent, in one currency. More...
class  Code
 A short uppercase code (letters, digits, _), stored inline without allocation. More...
struct  CommissionRate
 One commission rate, the market and venue it applies to, and the dates it applies on. More...
struct  CommissionSchedule
 The commission rates a broker published for an account, or a caller stated. More...
class  Currency
 A three-letter currency code, such as KRW or USD (ISO 4217 style). More...
struct  DataOnlyTraits
 A base for the BrokerTraits of a market-data client that cannot trade. More...
struct  Date
 A calendar date with no time of day or time zone. More...
class  Decimal64
 An exact signed decimal: an int64 coefficient times 10^-scale. More...
struct  DepthLevel
 One price level of an order book. More...
struct  DepthSnapshot
 An instrument's order book: resting bids and offers. More...
struct  HoldingPosition
 One position row in a holdings snapshot. More...
struct  HoldingsSnapshot
 An account's positions and per-currency totals at one point in time. More...
struct  HoldingsTotals
 The broker's holdings totals for one currency. More...
struct  Instrument
 Reference data for one instrument. More...
struct  InstrumentId
 Identifies an instrument: its country, venue and symbol. More...
struct  MarketSegment
 The market segment an instrument is listed on, such as KOSPI or NASDAQ. More...
struct  Money
 An exact amount of money in one currency. More...
struct  OrderAck
 The broker's acknowledgement that it accepted an instruction. More...
struct  OrderExecution
 What has filled on one order, and what it cost. More...
struct  OrderHistoryQuery
 The filter for an order-history inquiry. More...
struct  OrderPage
 One page of an order listing. More...
struct  OrderRef
 A broker's reference to one order, used to amend or cancel it. More...
struct  OrderRequest
 An order to place, in broker-neutral form. More...
struct  OrderShape
 An order's type, price, trigger, time in force and session, as an amendment states them. More...
struct  OrderSnapshot
 The state of one order, as a broker listing reported it. More...
struct  PlacedOrder
 An accepted order: the acknowledgement and the reference to address it with. More...
struct  PriceLimits
 The highest and lowest price an instrument may trade at today. More...
struct  PriceRule
 The price grid (tick sizes) an instrument's order prices must sit on. More...
struct  QuoteSnapshot
 A quote: the last traded price of an instrument at a point in time. More...
class  Result
 Either a value or a BrokerError. More...
struct  SellableBasis
 What a sellable quantity covers, and how RiskGuard must treat resting sells against it. More...
class  StatedDate
 A date a broker stated, did not state, or stated in a form that could not be read. More...
struct  TickBand
 One band of a price grid: the tick size from a price upward, until the next band. More...
struct  TopOfBook
 The best bid and offer, with the size at each. An absent field was not stated, never zero. More...
struct  TradePrint
 One executed trade, as the broker reported it. More...
struct  TradingCalendar
 The trading days a broker reported for one market, ascending by date. More...
struct  TradingDay
 One calendar date and whether the market opens on it. More...
class  VenueKey
 Which venue a commission rate applies to: any venue, a normalized Venue, or a raw code. More...
struct  WorkingOrder
 An order still open to modification or cancellation. More...
struct  WorkingOrders
 The orders open to modification or cancellation at one point in time. More...

Typedefs

using tcp = net::ip::tcp
 Short for boost::asio::ip::tcp.

Enumerations

enum class  SecurityType {
  UNKNOWN , STOCK , FOREIGN_STOCK , DEPOSITARY_RECEIPT ,
  INFRASTRUCTURE_FUND , REIT , ETF , FOREIGN_ETF ,
  ETN , STOCK_WARRANT
}
 What kind of security an instrument is. More...
enum class  InstrumentStatus { UNKNOWN , SCHEDULED , ACTIVE , DELISTED }
 Whether an instrument is listed, awaiting listing, or delisted. More...
enum class  DateExclusion { EXCLUDED , NOT_EXCLUDED , UNREADABLE }
 What an instrument's listing and delisting dates say about one day. More...
enum class  BarInterval {
  ONE_MINUTE , ONE_DAY , ONE_WEEK , ONE_MONTH ,
  ONE_YEAR , FIVE_MINUTES , FIFTEEN_MINUTES , THIRTY_MINUTES ,
  ONE_HOUR
}
 The period one bar covers. More...
enum class  BarStamp { OPEN , CLOSE }
 Which edge of its period a bar's timestamp marks. More...
enum class  Country { KR , US }
 A country (market) the library supports. More...
enum class  Venue { UNSPECIFIED , KRX , NXT , COMBINED }
 A trading venue: an exchange, or the combined view across exchanges. More...
enum class  ErrorCategory {
  CANCELLED , TRANSPORT , HTTP , AUTHENTICATION ,
  RATE_LIMIT , PROTOCOL , INVALID_ARGUMENT
}
 The kind of failure a BrokerError reports. More...
enum class  SellableSource { HOLDINGS , INQUIRY , NONE }
 Where the library gets a broker's sellable quantity. More...
enum class  VenueKeyKind { ANY , NORMALIZED , RAW }
 Which kind of venue a VenueKey names. More...
enum class  CommissionOrigin { BROKER_PUBLISHED , CALLER_STATED }
 Where a commission schedule's numbers came from. More...
enum class  RateApplicability { NO , YES , UNREADABLE }
 Whether a commission rate applies on a date. More...
enum class  OrderSide { BUY , SELL }
 The side of an order: its economic direction, buy or sell. More...
enum class  OrderType {
  UNKNOWN , LIMIT , MARKET , CONDITIONAL_LIMIT ,
  BEST_LIMIT , PRIMARY_LIMIT , MID_PRICE , STOP_LIMIT ,
  CLOSING_PRICE
}
 How an order's price is decided (its price basis). More...
enum class  TimeInForce { UNKNOWN , DAY , IMMEDIATE_OR_CANCEL , FILL_OR_KILL }
 How long an order stays valid and what happens to an unfilled remainder. More...
enum class  OrderSession {
  UNKNOWN , REGULAR , OPENING_AUCTION , CLOSING_AUCTION ,
  PRE_MARKET , AFTER_HOURS , AFTER_HOURS_AUCTION , AFTER_MARKET ,
  GTP
}
 The trading session an order is submitted into. More...
enum class  OrderStatus {
  UNKNOWN , PENDING , PENDING_CANCEL , PENDING_REPLACE ,
  PARTIAL_FILLED , FILLED , CANCELED , REJECTED ,
  CANCEL_REJECTED , REPLACE_REJECTED , REPLACED
}
 Where an order stands in its lifecycle. More...

Functions

constexpr Venue kis_effective_route (Venue asked) noexcept
 Returns the venue a KIS order actually reaches.
constexpr Venue kiwoom_route (Venue asked) noexcept
 Returns the venue a Kiwoom order reaches: the one it names. Kiwoom has no default venue, so an order naming none is refused before sending.
template<typename Caps>
constexpr bool reads_every_capability ()
 Reads every capability constant of a capability set, so a missing one fails to compile here.
template<typename Client>
constexpr bool answers_every_capability ()
 Reads every capability of a client's traits (see reads_every_capability).
template<typename Client, typename CompletionToken>
auto async_accounts (Client &client, CompletionToken &&token)
 Lists a broker's accounts, before a session exists; requires BrokerCaps<Client>::has_account_discovery (KIS reads its account from configuration).
template<typename Client>
Result< std::vector< AccountInfo< Client > > > list_accounts (Client &client)
 Lists a broker's accounts with a blocking client, before a session exists; requires BrokerCaps<Client>::has_account_discovery.
template<typename Enum, std::size_t N, typename IsEnumerator>
constexpr bool lists_every_value (const std::array< Enum, N > &values, IsEnumerator is_enumerator) noexcept
 Tests whether a list holds every value of an enum exactly once, in any order.
template<typename Enum, std::size_t N, typename IsEnumerator>
constexpr bool lists_every_value (const Enum(&values)[N], IsEnumerator is_enumerator) noexcept
 Tests whether a list holds every value of an enum exactly once, in any order.
template<typename Enum, std::size_t N, typename Name>
constexpr std::optional< Enum > value_named (const std::array< Enum, N > &values, Name name, std::string_view text) noexcept
 Returns the value of a list whose name is text, so a parser reads exactly what its writer writes.
MarketSegment market_segment (std::string_view code)
 Maps a broker's segment code to a MarketSegment.
PriceRule price_rule_for (Country country, SecurityType type)
 Returns the library's price grid for a kind of security in a country.
constexpr std::string_view bar_interval_name (BarInterval interval) noexcept
 Returns a short name for an interval, such as "1m", "5m", "1h" or "1d".
constexpr std::optional< std::chrono::seconds > bar_interval_length (BarInterval interval) noexcept
 Returns an interval's fixed length, for an intraday interval.
void order_depth (DepthSnapshot &book)
 Sorts a book's levels best first: bids descending, asks ascending.
constexpr std::string_view venue_name (Venue venue) noexcept
 Returns a display name for a venue, such as "KRX".
Decimal64 decimal_normalized (const Decimal64 &value)
 Removes trailing fractional zeros, so equal numbers compare equal with ==.
std::optional< Decimal64 > decimal_add (const Decimal64 &lhs, const Decimal64 &rhs)
 Adds two decimals exactly.
std::optional< Decimal64 > decimal_subtract (const Decimal64 &lhs, const Decimal64 &rhs)
 Subtracts two decimals exactly.
std::optional< Decimal64 > decimal_halve (const Decimal64 &value)
 Halves a decimal exactly, adding a decimal place when needed.
std::optional< Decimal64 > decimal_multiply (const Decimal64 &lhs, const Decimal64 &rhs)
 Multiplies two decimals exactly; the scales add.
std::optional< Decimal64 > decimal_divide (const Decimal64 &lhs, const Decimal64 &rhs, std::uint8_t scale)
 Divides two decimals, truncating toward zero at a given scale.
std::optional< Decimal64 > decimal_floor_to_multiple (const Decimal64 &value, const Decimal64 &step)
 Rounds down to a multiple of a step (toward negative infinity).
bool decimal_less (const Decimal64 &lhs, const Decimal64 &rhs)
 Compares two decimals numerically, whatever their scales.
constexpr bool error_category_is_rate_limit (ErrorCategory category) noexcept
 Tests whether an error of this category is a broker asking the caller to slow down, so the request may be tried again later and the pacer should hold.
constexpr std::string_view sellable_coverage_name (SellableBasis::Coverage coverage) noexcept
 Returns a lowercase name for a coverage, such as "whole_holding", for logs.
constexpr std::string_view sellable_resting_name (SellableBasis::RestingTreatment treatment) noexcept
 Returns a lowercase name for a treatment, such as "deduct", for logs.
constexpr std::string_view sellable_source_name (SellableSource source) noexcept
 Returns a lowercase name for a source, such as "inquiry", for logs.
Date date_from_epoch_days (std::int64_t days)
 Converts a day count since 1970-01-01 to a Gregorian date.
bool is_valid_date (const Date &date)
 Tests whether a date exists in the Gregorian calendar, in years 1 to 9999.
constexpr std::string_view venue_key_kind_name (VenueKeyKind kind) noexcept
 Returns a lowercase name for a key kind, such as "raw", for reports.
constexpr bool commission_origin_is_broker (CommissionOrigin origin) noexcept
 Tests whether commission rates of this origin came from the broker.
constexpr bool commission_origin_names_tariff (CommissionOrigin origin) noexcept
 Tests whether a schedule of this origin must name the tariff it was read from.
constexpr std::string_view commission_origin_name (CommissionOrigin origin) noexcept
 Returns a lowercase name for an origin, such as "caller_stated", for reports.
constexpr bool carries_caller_price (OrderType type) noexcept
 Tests whether an order type takes a price from the caller.
constexpr bool carries_trigger_price (OrderType type) noexcept
 Tests whether an order type takes a trigger price.
constexpr bool time_in_force_expires_at_close (TimeInForce condition) noexcept
 Tests whether an order with this condition expires at the session's close, so its filled quantity is final once the session has ended.
constexpr bool order_status_cancel_pending (OrderStatus status) noexcept
 Tests whether a cancellation of an order in this status is already on its way, so asking again can only be refused.
std::optional< Decimal64 > amended_trigger_price (const AmendInstruction &instruction)
 Returns the trigger price an amendment leaves the order with.
template<typename Broker>
OrderShape resting_shape (const WorkingOrder< Broker > &order)
 Returns a working order's current shape.
template<typename Broker>
AmendInstruction cancel_all (const WorkingOrder< Broker > &order)
 Makes an instruction cancelling all that remains of an order.
template<typename Broker>
AmendInstruction cancel_quantity (const WorkingOrder< Broker > &order, Decimal64 quantity)
 Makes an instruction cancelling part of an order.
template<typename Broker>
AmendInstruction replace_with (const WorkingOrder< Broker > &order, OrderShape shape, std::optional< Decimal64 > quantity=std::nullopt)
 Makes an instruction changing a working order to a new shape.
template<typename Broker>
AmendInstruction reprice (const WorkingOrder< Broker > &order, Decimal64 price, std::optional< Decimal64 > quantity=std::nullopt)
 Makes an instruction changing only a working order's price.
std::string format_iso8601_utc (std::chrono::system_clock::time_point value)
 Formats an instant as an ISO 8601 timestamp in UTC, such as 2026-10-06T00:30:00Z.
std::optional< std::chrono::system_clock::time_point > parse_iso8601_timestamp (std::string_view value)
 Parses an ISO 8601 timestamp, YYYY-MM-DDTHH:MM:SS[.fraction] followed by Z or a +hh:mm/-hh:mm offset.

Variables

constexpr std::array< BarInterval, 9 > all_bar_intervals
 Every BarInterval, in declaration order.
constexpr std::array< Country, 2 > all_countries {Country::KR, Country::US}
 Every Country, in declaration order.
constexpr std::array< Venue, 4 > all_venues {Venue::UNSPECIFIED, Venue::KRX, Venue::NXT, Venue::COMBINED}
 Every Venue, in declaration order.
constexpr std::array< OrderSide, 2 > all_order_sides {OrderSide::BUY, OrderSide::SELL}
 Every OrderSide, in declaration order.
constexpr std::array< OrderType, 9 > all_order_types
 Every OrderType, in declaration order.
constexpr std::array< TimeInForce, 4 > all_times_in_force
 Every TimeInForce, in declaration order.
constexpr std::array< OrderSession, 9 > all_order_sessions
 Every OrderSession, in declaration order.

Detailed Description

The library: broker-neutral types (core), and the modules below.

Include <algotradelib/core> for orders, quotes, bars, instruments and the calendar, and <algotradelib/broker> for the broker port (BrokerSession, BlockingSession, BrokerTraits, BrokerCaps); each module has its own umbrella header (<algotradelib/runner>, <algotradelib/kis>, ...).

Typedef Documentation

◆ tcp

using algotradelib::tcp = net::ip::tcp

Short for boost::asio::ip::tcp.

Definition at line 43 of file http_client.hpp.

Enumeration Type Documentation

◆ BarInterval

enum class algotradelib::BarInterval
strong

The period one bar covers.

Only periods a broker publishes; an interval a broker does not publish is refused, not built by aggregating shorter bars.

Enumerator
FIVE_MINUTES 

Five minutes.

FIFTEEN_MINUTES 

Fifteen minutes.

THIRTY_MINUTES 

Thirty minutes.

ONE_HOUR 

Sixty minutes.

Definition at line 20 of file market_data.hpp.

◆ BarStamp

enum class algotradelib::BarStamp
strong

Which edge of its period a bar's timestamp marks.

Brokers differ: Toss stamps a minute bar at its close (covering [t - 1m, t)) and a daily bar at local midnight, its open; KIS reports a daily bar by its trading date. Reading an open-stamped bar as close-stamped looks ahead by one bar.

Enumerator
OPEN 

The timestamp is the first instant of the period.

CLOSE 

The timestamp is the instant the period ended.

Definition at line 117 of file market_data.hpp.

◆ CommissionOrigin

enum class algotradelib::CommissionOrigin
strong

Where a commission schedule's numbers came from.

Enumerator
BROKER_PUBLISHED 

The broker published them, through an inquiry the library made.

CALLER_STATED 

The caller stated them, from a fee page or their own agreement.

Definition at line 1374 of file types.hpp.

◆ Country

enum class algotradelib::Country
strong

A country (market) the library supports.

Adding a country requires its broker mappings; an unknown wire value is never mapped onto one of these.

Definition at line 30 of file types.hpp.

◆ DateExclusion

enum class algotradelib::DateExclusion
strong

What an instrument's listing and delisting dates say about one day.

Enumerator
EXCLUDED 

A readable date rules the day out: listed after it, or delisted on or before it.

NOT_EXCLUDED 

No date rules it out and neither is unreadable. This does not mean "listed".

UNREADABLE 

No readable date rules it out, but an unreadable date might.

Definition at line 459 of file instrument.hpp.

◆ ErrorCategory

enum class algotradelib::ErrorCategory
strong

The kind of failure a BrokerError reports.

For an order, runner::outcome_of turns the category into whether the order may exist.

Enumerator
CANCELLED 

The operation was cancelled, such as by closing the client or a local deadline.

TRANSPORT 

The connection failed (DNS, connect, TLS, write or read).

HTTP 

The broker answered with an HTTP error status (http_status_).

AUTHENTICATION 

The credentials or token were refused.

RATE_LIMIT 

The broker refused the request for its rate limit.

PROTOCOL 

The reply could not be read, or the broker declared a failure this client does not classify further: at KIS an unrecognized reply with rt_cd not 0 (such as insufficient balance), at Toss any refusal but a rate limit or a refused token (AUTHENTICATION), at Kiwoom a return_code outside its documented error list. For an order it means the outcome is unknown.

INVALID_ARGUMENT 

The request was invalid, refused by the client before sending or by the broker.

By the broker: reached_broker_ is set. That includes the order refusals the KIS and Kiwoom clients recognize, each from the server it was seen from: from their demo servers nothing to sell, the market not yet open or closed, and nothing left to cancel; from their real servers KIS's after-market session refusal and Kiwoom's no-balance and nothing-left-to-cancel refusals.

Definition at line 687 of file types.hpp.

◆ InstrumentStatus

enum class algotradelib::InstrumentStatus
strong

Whether an instrument is listed, awaiting listing, or delisted.

Definition at line 125 of file instrument.hpp.

◆ OrderSession

enum class algotradelib::OrderSession
strong

The trading session an order is submitted into.

A session the broker does not offer is refused on a request before any I/O.

Enumerator
REGULAR 

The continuous regular session.

OPENING_AUCTION 

The opening single-price auction (시가단일가; Toss OPG).

CLOSING_AUCTION 

The closing auction (Toss CLS, a US limit-on-close).

PRE_MARKET 

Before the open, at the previous session's close (장전 시간외).

AFTER_HOURS 

After the close, at that session's close (장후 시간외).

AFTER_HOURS_AUCTION 

The after-hours single-price auction (시간외 단일가).

AFTER_MARKET 

KRX's after-market session (애프터마켓).

GTP 

NXT's GTP session.

Definition at line 1839 of file types.hpp.

◆ OrderSide

enum class algotradelib::OrderSide
strong

The side of an order: its economic direction, buy or sell.

Closed at two values. A short sale is a sell and a cover is a buy; a mark that says which (short, short-exempt, cover only) is a separate fact this library does not carry yet.

Definition at line 1683 of file types.hpp.

◆ OrderStatus

enum class algotradelib::OrderStatus
strong

Where an order stands in its lifecycle.

CANCEL_REJECTED, REPLACE_REJECTED and REPLACED describe a cancel or modify instruction, which brokers list as rows of their own. UNKNOWN is a status the library does not recognize; one such row does not fail a listing.

Definition at line 1879 of file types.hpp.

◆ OrderType

enum class algotradelib::OrderType
strong

How an order's price is decided (its price basis).

The execution condition is TimeInForce and the session is OrderSession; a broker's single order code (such as KIS ORD_DVSN) maps to all three. A request is accepted only for combinations the broker publishes; an adapter refuses others before any I/O. On a read, an unrecognized combination is UNKNOWN. carries_caller_price says which bases take a price.

Enumerator
LIMIT 

지정가: fills at the stated price or better.

MARKET 

시장가: fills at whatever the book offers.

CONDITIONAL_LIMIT 

조건부지정가: a limit that becomes a market order at the close.

BEST_LIMIT 

최유리지정가: priced at the best quote on the opposite side.

PRIMARY_LIMIT 

최우선지정가: priced at the best quote on the order's own side.

MID_PRICE 

중간가: priced at the midpoint of the spread.

STOP_LIMIT 

스톱지정가: a limit released when a trigger price is reached.

CLOSING_PRICE 

시간외종가: priced at a session's closing price.

Definition at line 1707 of file types.hpp.

◆ RateApplicability

Whether a commission rate applies on a date.

Enumerator
NO 

A readable date bound puts the date outside the rate's window.

YES 

Every bound was readable, and they cover the date.

UNREADABLE 

Unknown: no readable bound excludes the date, but a bound could not be read.

Do not fall back to another rate on this answer; the unreadable row may be the one in force.

Definition at line 1427 of file types.hpp.

◆ SecurityType

enum class algotradelib::SecurityType
strong

What kind of security an instrument is.

UNKNOWN appears only on reads, for a type the library does not normalize.

Definition at line 111 of file instrument.hpp.

◆ SellableSource

enum class algotradelib::SellableSource
strong

Where the library gets a broker's sellable quantity.

Enumerator
HOLDINGS 

On the holdings snapshot, at no extra request.

INQUIRY 

From a per-instrument inquiry, made only where the snapshot has no figure.

NONE 

No per-instrument inquiry: any figure comes on the holdings rows (Kiwoom), or there is none.

Definition at line 1092 of file types.hpp.

◆ TimeInForce

enum class algotradelib::TimeInForce
strong

How long an order stays valid and what happens to an unfilled remainder.

The session is a separate field, OrderSession: an at-the-close order is DAY in the CLOSING_AUCTION session. UNKNOWN appears only on reads, never on requests.

Enumerator
DAY 

Rests until the session ends; an unfilled remainder is cancelled then.

IMMEDIATE_OR_CANCEL 

Fills what it can immediately and cancels the remainder.

FILL_OR_KILL 

Fills entirely and immediately, or not at all.

Definition at line 1797 of file types.hpp.

◆ Venue

enum class algotradelib::Venue
strong

A trading venue: an exchange, or the combined view across exchanges.

UNSPECIFIED leaves routing to the broker's default. Broker wire codes stay in the adapters.

Definition at line 43 of file types.hpp.

◆ VenueKeyKind

enum class algotradelib::VenueKeyKind
strong

Which kind of venue a VenueKey names.

Enumerator
ANY 

Any venue (a venue-neutral rate).

NORMALIZED 

A Venue the library normalizes.

RAW 

A broker venue code the library does not normalize, kept verbatim.

Definition at line 1228 of file types.hpp.

Function Documentation

◆ amended_trigger_price()

std::optional< Decimal64 > algotradelib::amended_trigger_price ( const AmendInstruction & instruction)
inline

Returns the trigger price an amendment leaves the order with.

Parameters
instructionThe amendment.
Returns
The trigger shape_ states; otherwise the resting order's trigger if both shapes are STOP_LIMIT; otherwise std::nullopt.

Definition at line 2271 of file types.hpp.

Referenced by amended_trigger_price().

◆ answers_every_capability()

template<typename Client>
bool algotradelib::answers_every_capability ( )
constexpr

Reads every capability of a client's traits (see reads_every_capability).

Template Parameters
ClientThe broker client type.
Returns
Always true; a missing capability fails to compile.

Definition at line 259 of file broker_caps.hpp.

Referenced by answers_every_capability().

◆ async_accounts()

template<typename Client, typename CompletionToken>
auto algotradelib::async_accounts ( Client & client,
CompletionToken && token )

Lists a broker's accounts, before a session exists; requires BrokerCaps<Client>::has_account_discovery (KIS reads its account from configuration).

Template Parameters
ClientAn asynchronous broker client type.
CompletionTokenA completion token for void(Result<std::vector<AccountInfo<Client>>>).
Parameters
clientThe client.
tokenThe completion token; the handler runs once, on its associated executor.
Returns
Whatever token produces.

Definition at line 1274 of file broker_session.hpp.

Referenced by async_accounts(), and algotradelib::conformance::call_claimed_async_verbs().

◆ bar_interval_length()

std::optional< std::chrono::seconds > algotradelib::bar_interval_length ( BarInterval interval)
inlineconstexprnoexcept

Returns an interval's fixed length, for an intraday interval.

Parameters
intervalThe interval.
Returns
60, 300, 900, 1800 or 3600 seconds; std::nullopt for a day or longer, which has no fixed trading length (a trading day is not 24 hours, and a month has no fixed length).

Definition at line 84 of file market_data.hpp.

Referenced by bar_interval_length(), and algotradelib::backtest::interval_duration().

◆ bar_interval_name()

std::string_view algotradelib::bar_interval_name ( BarInterval interval)
inlineconstexprnoexcept

Returns a short name for an interval, such as "1m", "5m", "1h" or "1d".

Parameters
intervalThe interval.
Returns
The name; empty for a value that is not a BarInterval.

Definition at line 54 of file market_data.hpp.

Referenced by bar_interval_name(), algotradelib::kis::unsupported_bar_interval(), and algotradelib::kiwoom::unsupported_bar_interval().

◆ cancel_all()

template<typename Broker>
AmendInstruction algotradelib::cancel_all ( const WorkingOrder< Broker > & order)
inline

Makes an instruction cancelling all that remains of an order.

Template Parameters
BrokerThe broker tag.
Parameters
orderThe working order.
Returns
The instruction, carrying the order's shape, venue and amendable quantity.

Definition at line 2362 of file types.hpp.

Referenced by algotradelib::live::SessionExecutor< Session >::cancel(), and cancel_all().

◆ cancel_quantity()

template<typename Broker>
AmendInstruction algotradelib::cancel_quantity ( const WorkingOrder< Broker > & order,
Decimal64 quantity )
inline

Makes an instruction cancelling part of an order.

Template Parameters
BrokerThe broker tag.
Parameters
orderThe working order.
quantityThe quantity to cancel; check BrokerCaps::has_partial_cancel first.
Returns
The instruction.

Definition at line 2385 of file types.hpp.

Referenced by cancel_quantity().

◆ carries_caller_price()

bool algotradelib::carries_caller_price ( OrderType type)
inlineconstexprnoexcept

Tests whether an order type takes a price from the caller.

A type that does not is sent without a price; a type that does must have one.

Parameters
typeThe order type.
Returns
true for LIMIT, CONDITIONAL_LIMIT and STOP_LIMIT.

Definition at line 1748 of file types.hpp.

Referenced by carries_caller_price(), and algotradelib::runner::unresolvable_reason().

◆ carries_trigger_price()

bool algotradelib::carries_trigger_price ( OrderType type)
inlineconstexprnoexcept

Tests whether an order type takes a trigger price.

A trigger stated on any other type is refused, not dropped. The trigger's direction, tick grid and relation to the limit are the broker's rules and are not checked by the library.

Parameters
typeThe order type.
Returns
true for STOP_LIMIT only.

Definition at line 1774 of file types.hpp.

Referenced by amended_trigger_price(), carries_trigger_price(), algotradelib::backtest::NextBarFillModel::decide(), algotradelib::kiwoom::invalid_trigger(), algotradelib::strategy::is_stop_order(), and algotradelib::runner::unresolvable_reason().

◆ commission_origin_is_broker()

bool algotradelib::commission_origin_is_broker ( CommissionOrigin origin)
inlineconstexprnoexcept

Tests whether commission rates of this origin came from the broker.

Parameters
originThe origin.
Returns
true for BROKER_PUBLISHED.

Definition at line 1386 of file types.hpp.

Referenced by algotradelib::backtest::commission_model_from(), and commission_origin_is_broker().

◆ commission_origin_name()

std::string_view algotradelib::commission_origin_name ( CommissionOrigin origin)
inlineconstexprnoexcept

Returns a lowercase name for an origin, such as "caller_stated", for reports.

Parameters
originThe origin.
Returns
The name.

Definition at line 1416 of file types.hpp.

Referenced by commission_origin_name().

◆ commission_origin_names_tariff()

bool algotradelib::commission_origin_names_tariff ( CommissionOrigin origin)
inlineconstexprnoexcept

Tests whether a schedule of this origin must name the tariff it was read from.

Parameters
originThe origin.
Returns
true for CALLER_STATED: nothing else says which channel's published table it is.

Definition at line 1401 of file types.hpp.

Referenced by commission_origin_names_tariff(), and algotradelib::backtest::CommissionPolicy::scheduled().

◆ date_from_epoch_days()

Date algotradelib::date_from_epoch_days ( std::int64_t days)
inline

Converts a day count since 1970-01-01 to a Gregorian date.

Howard Hinnant's civil_from_days, exact for any day count whose year fits an int (far beyond years 1 to 9999). The result is not checked against is_valid_date's year range.

Parameters
daysDays after 1970-01-01; negative counts go backwards.
Returns
The date.

Definition at line 1186 of file types.hpp.

Referenced by date_from_epoch_days(), and algotradelib::strategy::SessionWindow::local_date().

◆ decimal_add()

◆ decimal_divide()

std::optional< Decimal64 > algotradelib::decimal_divide ( const Decimal64 & lhs,
const Decimal64 & rhs,
std::uint8_t scale )
inline

Divides two decimals, truncating toward zero at a given scale.

decimal_divide(x, y, 0) is the number of whole y in x, as when sizing an order in shares.

Parameters
lhsThe dividend.
rhsThe divisor.
scaleThe number of fractional digits to keep.
Returns
The normalized quotient, or std::nullopt if rhs is zero, or the rescaled operands or the dividend multiplied by 10^scale do not fit.

Definition at line 602 of file types.hpp.

Referenced by algotradelib::backtest::SlippageModel::apply(), decimal_divide(), algotradelib::backtest::CommissionModel::on(), algotradelib::strategy::vanilla::VolatilityTargetSizing::on_bar(), algotradelib::strategy::vanilla::EqualWeightRebalance::on_phase(), algotradelib::strategy::reconcile(), and algotradelib::strategy::weight_target().

◆ decimal_floor_to_multiple()

std::optional< Decimal64 > algotradelib::decimal_floor_to_multiple ( const Decimal64 & value,
const Decimal64 & step )
inline

Rounds down to a multiple of a step (toward negative infinity).

The result is never greater than value, on either side of zero.

Parameters
valueThe value.
stepThe step, such as a lot size; must be positive.
Returns
The largest multiple of step not above value, or std::nullopt if step is not positive, the operands rescaled to a common scale do not fit, or the result does not fit (a negative value near the smallest int64 coefficient).

Definition at line 639 of file types.hpp.

Referenced by algotradelib::backtest::NextBarFillModel::decide(), and decimal_floor_to_multiple().

◆ decimal_halve()

std::optional< Decimal64 > algotradelib::decimal_halve ( const Decimal64 & value)
inline

Halves a decimal exactly, adding a decimal place when needed.

Parameters
valueThe value.
Returns
The normalized half, or std::nullopt if it does not fit.

Definition at line 549 of file types.hpp.

Referenced by decimal_halve(), and algotradelib::DepthSnapshot::mid().

◆ decimal_less()

◆ decimal_multiply()

std::optional< Decimal64 > algotradelib::decimal_multiply ( const Decimal64 & lhs,
const Decimal64 & rhs )
inline

Multiplies two decimals exactly; the scales add.

Parameters
lhsThe first factor.
rhsThe second factor.
Returns
The normalized product, or std::nullopt if the product of the coefficients or the sum of the scales does not fit (checked before trailing zeros are removed).

Definition at line 571 of file types.hpp.

Referenced by algotradelib::backtest::ReplayLedger::apply(), algotradelib::backtest::SlippageModel::apply(), algotradelib::backtest::NextBarFillModel::decide(), decimal_multiply(), algotradelib::backtest::ReplayLedger::equity_in(), algotradelib::strategy::RiskGuard::evaluate(), algotradelib::backtest::ReplayLedger::mark(), algotradelib::backtest::CommissionModel::on(), algotradelib::strategy::projected_gross_exposure(), algotradelib::strategy::reconcile(), and algotradelib::strategy::weight_target().

◆ decimal_normalized()

Decimal64 algotradelib::decimal_normalized ( const Decimal64 & value)
inline

Removes trailing fractional zeros, so equal numbers compare equal with ==.

Parameters
valueThe value.
Returns
The same number at the smallest scale that represents it.

Definition at line 455 of file types.hpp.

Referenced by decimal_add(), decimal_divide(), decimal_floor_to_multiple(), decimal_halve(), decimal_multiply(), decimal_normalized(), decimal_subtract(), and algotradelib::PriceRule::round_to_tick().

◆ decimal_subtract()

◆ error_category_is_rate_limit()

bool algotradelib::error_category_is_rate_limit ( ErrorCategory category)
inlineconstexprnoexcept

Tests whether an error of this category is a broker asking the caller to slow down, so the request may be tried again later and the pacer should hold.

Parameters
categoryThe category.
Returns
true for RATE_LIMIT only.

Definition at line 722 of file types.hpp.

Referenced by algotradelib::runner::broker_rate_limited(), error_category_is_rate_limit(), and algotradelib::live::poll_outcome_of().

◆ format_iso8601_utc()

std::string algotradelib::format_iso8601_utc ( std::chrono::system_clock::time_point value)
inline

Formats an instant as an ISO 8601 timestamp in UTC, such as 2026-10-06T00:30:00Z.

Parameters
valueThe instant; fractions of a second are dropped.
Returns
The text.

Definition at line 2453 of file types.hpp.

Referenced by format_iso8601_utc(), and algotradelib::runner::journal_entry_to_line().

◆ is_valid_date()

bool algotradelib::is_valid_date ( const Date & date)
inline

Tests whether a date exists in the Gregorian calendar, in years 1 to 9999.

Parameters
dateThe date.
Returns
true if valid.

Definition at line 1212 of file types.hpp.

Referenced by is_valid_date(), and parse_iso8601_timestamp().

◆ kis_effective_route()

Venue algotradelib::kis_effective_route ( Venue asked)
inlineconstexprnoexcept

Returns the venue a KIS order actually reaches.

Parameters
askedThe order's venue.
Returns
KRX if asked is UNSPECIFIED (KIS's documented default), otherwise asked.

Definition at line 394 of file traits.hpp.

Referenced by algotradelib::BrokerTraits< kis::KisBlockingClient >::effective_route(), algotradelib::BrokerTraits< kis::KisClient >::effective_route(), and kis_effective_route().

◆ kiwoom_route()

Venue algotradelib::kiwoom_route ( Venue asked)
inlineconstexprnoexcept

Returns the venue a Kiwoom order reaches: the one it names. Kiwoom has no default venue, so an order naming none is refused before sending.

Parameters
askedThe order's venue.
Returns
asked.

Definition at line 573 of file traits.hpp.

Referenced by algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::effective_route(), algotradelib::BrokerTraits< kiwoom::KiwoomClient >::effective_route(), and kiwoom_route().

◆ list_accounts()

template<typename Client>
Result< std::vector< AccountInfo< Client > > > algotradelib::list_accounts ( Client & client)

Lists a broker's accounts with a blocking client, before a session exists; requires BrokerCaps<Client>::has_account_discovery.

Template Parameters
ClientA blocking broker client type.
Parameters
clientThe client.
Returns
The accounts, or an error.

Definition at line 1311 of file broker_session.hpp.

Referenced by algotradelib::conformance::call_claimed_blocking_verbs(), and list_accounts().

◆ lists_every_value() [1/2]

template<typename Enum, std::size_t N, typename IsEnumerator>
bool algotradelib::lists_every_value ( const Enum(&) values[N],
IsEnumerator is_enumerator )
constexprnoexcept

Tests whether a list holds every value of an enum exactly once, in any order.

The same check for a built-in array, such as runner::all_poll_kinds.

Template Parameters
EnumThe enum.
NThe list's length.
IsEnumeratorA callable taking an Enum and returning bool.
Parameters
valuesThe list.
is_enumeratorWhether a value is one of the enum's.
Returns
true if values lists each of the enum's values once.

Definition at line 107 of file enum_values.hpp.

◆ lists_every_value() [2/2]

template<typename Enum, std::size_t N, typename IsEnumerator>
bool algotradelib::lists_every_value ( const std::array< Enum, N > & values,
IsEnumerator is_enumerator )
constexprnoexcept

Tests whether a list holds every value of an enum exactly once, in any order.

The enum must be scoped (enum class), and its values 0 to N - 1: no enumerator may state its own value. Then N distinct enumerators below N are all of them, and N itself must not be one, or the enum is longer than the list (unless N values already fill the underlying type).

Use it in a static_assert beside the list. Pass a test that is true exactly for the enum's values, such as the enum's name function, whose switch has a case for each value and returns "" after it:

static_assert(lists_every_value(all_venues, [](Venue venue) { return !venue_name(venue).empty(); }));
constexpr std::array< Venue, 4 > all_venues
Every Venue, in declaration order.
Definition types.hpp:51
constexpr bool lists_every_value(const std::array< Enum, N > &values, IsEnumerator is_enumerator) noexcept
Tests whether a list holds every value of an enum exactly once, in any order.
constexpr std::string_view venue_name(Venue venue) noexcept
Returns a display name for a venue, such as "KRX".
Definition types.hpp:58
Venue
A trading venue: an exchange, or the combined view across exchanges.
Definition types.hpp:43
Template Parameters
EnumThe enum.
NThe list's length.
IsEnumeratorA callable taking an Enum and returning bool.
Parameters
valuesThe list.
is_enumeratorWhether a value is one of the enum's.
Returns
true if values lists each of the enum's values once.

Definition at line 86 of file enum_values.hpp.

Referenced by lists_every_value(), and lists_every_value().

◆ market_segment()

MarketSegment algotradelib::market_segment ( std::string_view code)
inline

Maps a broker's segment code to a MarketSegment.

Parameters
codeThe code, such as "KOSDAQ".
Returns
The recognized segment, or UNKNOWN with the code kept in other_ if it fits (otherwise both are empty).

Definition at line 88 of file instrument.hpp.

Referenced by market_segment().

◆ order_depth()

void algotradelib::order_depth ( DepthSnapshot & book)
inline

Sorts a book's levels best first: bids descending, asks ascending.

Parameters
bookThe book to sort in place.

Definition at line 274 of file market_data.hpp.

Referenced by order_depth().

◆ order_status_cancel_pending()

bool algotradelib::order_status_cancel_pending ( OrderStatus status)
inlineconstexprnoexcept

Tests whether a cancellation of an order in this status is already on its way, so asking again can only be refused.

Parameters
statusThe status.
Returns
true for PENDING_CANCEL only.

Definition at line 1899 of file types.hpp.

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

◆ parse_iso8601_timestamp()

std::optional< std::chrono::system_clock::time_point > algotradelib::parse_iso8601_timestamp ( std::string_view value)
inline

Parses an ISO 8601 timestamp, YYYY-MM-DDTHH:MM:SS[.fraction] followed by Z or a +hh:mm/-hh:mm offset.

Fractional seconds are truncated to the millisecond.

Parameters
valueThe text, such as 2026-10-06T09:30:00.250+09:00.
Returns
The instant, or std::nullopt if the text is not exactly that form (a non-digit in the fraction, an offset outside -23:59..+23:59, or anything after the zone included), or the date or time is invalid.

Definition at line 2478 of file types.hpp.

Referenced by parse_iso8601_timestamp().

◆ price_rule_for()

PriceRule algotradelib::price_rule_for ( Country country,
SecurityType type )
inline

Returns the library's price grid for a kind of security in a country.

KRX stocks, foreign stocks, depositary receipts, infrastructure funds and REITs get the equity table; ETFs, ETNs, warrants and unknown types get an UNKNOWN rule. US listings are unconstrained, whatever their type.

Parameters
countryThe listing country.
typeThe security type.
Returns
The rule.

Definition at line 333 of file instrument.hpp.

Referenced by price_rule_for().

◆ reads_every_capability()

template<typename Caps>
bool algotradelib::reads_every_capability ( )
constexpr

Reads every capability constant of a capability set, so a missing one fails to compile here.

Template Parameters
CapsBrokerCaps<Client>, or a hand-written set such as strategy::NoCaps.
Returns
Always true.

Definition at line 217 of file broker_caps.hpp.

Referenced by answers_every_capability(), and reads_every_capability().

◆ replace_with()

template<typename Broker>
AmendInstruction algotradelib::replace_with ( const WorkingOrder< Broker > & order,
OrderShape shape,
std::optional< Decimal64 > quantity = std::nullopt )
inline

Makes an instruction changing a working order to a new shape.

An unset time in force or session stays as the order has it; an unset trigger stays only if both shape and the order are STOP_LIMIT (see amended_trigger_price). A set value is a deliberate change, made where the broker can and refused where it cannot. To change only the price, use reprice.

Template Parameters
BrokerThe broker tag.
Parameters
orderThe working order.
shapeThe new shape, such as OrderShape{OrderType::LIMIT, price}.
quantityThe quantity to amend, or unset for all that remains.
Returns
The instruction.

Definition at line 2414 of file types.hpp.

Referenced by replace_with(), and reprice().

◆ reprice()

template<typename Broker>
AmendInstruction algotradelib::reprice ( const WorkingOrder< Broker > & order,
Decimal64 price,
std::optional< Decimal64 > quantity = std::nullopt )
inline

Makes an instruction changing only a working order's price.

Template Parameters
BrokerThe broker tag.
Parameters
orderThe working order.
priceThe new price.
quantityThe quantity to amend, or unset for all that remains.
Returns
The instruction.

Definition at line 2438 of file types.hpp.

Referenced by reprice().

◆ resting_shape()

template<typename Broker>
OrderShape algotradelib::resting_shape ( const WorkingOrder< Broker > & order)
inline

Returns a working order's current shape.

Template Parameters
BrokerThe broker tag.
Parameters
orderThe working order.
Returns
Its type, price, trigger, time in force and session.

Definition at line 2345 of file types.hpp.

Referenced by replace_with(), reprice(), and resting_shape().

◆ sellable_coverage_name()

std::string_view algotradelib::sellable_coverage_name ( SellableBasis::Coverage coverage)
inlineconstexprnoexcept

Returns a lowercase name for a coverage, such as "whole_holding", for logs.

Parameters
coverageThe coverage.
Returns
The name.

Definition at line 987 of file types.hpp.

Referenced by sellable_coverage_name().

◆ sellable_resting_name()

std::string_view algotradelib::sellable_resting_name ( SellableBasis::RestingTreatment treatment)
inlineconstexprnoexcept

Returns a lowercase name for a treatment, such as "deduct", for logs.

Parameters
treatmentThe treatment.
Returns
The name.

Definition at line 1005 of file types.hpp.

Referenced by sellable_resting_name().

◆ sellable_source_name()

std::string_view algotradelib::sellable_source_name ( SellableSource source)
inlineconstexprnoexcept

Returns a lowercase name for a source, such as "inquiry", for logs.

Parameters
sourceThe source.
Returns
The name.

Definition at line 1106 of file types.hpp.

Referenced by sellable_source_name().

◆ time_in_force_expires_at_close()

bool algotradelib::time_in_force_expires_at_close ( TimeInForce condition)
inlineconstexprnoexcept

Tests whether an order with this condition expires at the session's close, so its filled quantity is final once the session has ended.

Parameters
conditionThe condition.
Returns
true for DAY; false for IMMEDIATE_OR_CANCEL and FILL_OR_KILL (never resting) and for UNKNOWN.

Definition at line 1822 of file types.hpp.

Referenced by algotradelib::runner::Runner< Strategy, CapsType, Tag, Executor >::feed(), and time_in_force_expires_at_close().

◆ value_named()

template<typename Enum, std::size_t N, typename Name>
std::optional< Enum > algotradelib::value_named ( const std::array< Enum, N > & values,
Name name,
std::string_view text )
constexprnoexcept

Returns the value of a list whose name is text, so a parser reads exactly what its writer writes.

Template Parameters
EnumThe enum.
NThe list's length.
NameA callable taking an Enum and returning something comparable with std::string_view.
Parameters
valuesEvery value of the enum, such as all_venues.
nameThe name function the writer uses.
textThe text to read.
Returns
The value named text, or std::nullopt if none is, and always for an empty text (what a name function returns for a value that is not an enumerator).

Definition at line 129 of file enum_values.hpp.

Referenced by algotradelib::runner::journal_action_from(), algotradelib::runner::journal_outcome_from(), algotradelib::runner::stop_intent_from(), and value_named().

◆ venue_key_kind_name()

std::string_view algotradelib::venue_key_kind_name ( VenueKeyKind kind)
inlineconstexprnoexcept

Returns a lowercase name for a key kind, such as "raw", for reports.

Parameters
kindThe kind.
Returns
The name.

Definition at line 1361 of file types.hpp.

Referenced by venue_key_kind_name().

◆ venue_name()

std::string_view algotradelib::venue_name ( Venue venue)
inlineconstexprnoexcept

Returns a display name for a venue, such as "KRX".

Parameters
venueThe venue.
Returns
The name; empty for a value that is not a Venue.

Definition at line 58 of file types.hpp.

Referenced by venue_name().

Variable Documentation

◆ all_bar_intervals

std::array<BarInterval, 9> algotradelib::all_bar_intervals
inlineconstexpr
Initial value:
{
BarInterval::ONE_MINUTE,
BarInterval::ONE_DAY,
BarInterval::ONE_WEEK,
BarInterval::ONE_MONTH,
BarInterval::ONE_YEAR,
}
@ FIVE_MINUTES
Five minutes.
@ THIRTY_MINUTES
Thirty minutes.
@ FIFTEEN_MINUTES
Fifteen minutes.

Every BarInterval, in declaration order.

Definition at line 37 of file market_data.hpp.

◆ all_countries

std::array<Country, 2> algotradelib::all_countries {Country::KR, Country::US}
inlineconstexpr

Every Country, in declaration order.

Definition at line 36 of file types.hpp.

◆ all_order_sessions

std::array<OrderSession, 9> algotradelib::all_order_sessions
inlineconstexpr
Initial value:
{
OrderSession::UNKNOWN,
}
@ OPENING_AUCTION
The opening single-price auction (시가단일가; Toss OPG).
Definition types.hpp:1844
@ AFTER_HOURS
After the close, at that session's close (장후 시간외).
Definition types.hpp:1850
@ CLOSING_AUCTION
The closing auction (Toss CLS, a US limit-on-close).
Definition types.hpp:1846
@ REGULAR
The continuous regular session.
Definition types.hpp:1842
@ AFTER_MARKET
KRX's after-market session (애프터마켓).
Definition types.hpp:1854
@ AFTER_HOURS_AUCTION
The after-hours single-price auction (시간외 단일가).
Definition types.hpp:1852
@ PRE_MARKET
Before the open, at the previous session's close (장전 시간외).
Definition types.hpp:1848
@ GTP
NXT's GTP session.
Definition types.hpp:1856

Every OrderSession, in declaration order.

Definition at line 1860 of file types.hpp.

◆ all_order_sides

std::array<OrderSide, 2> algotradelib::all_order_sides {OrderSide::BUY, OrderSide::SELL}
inlineconstexpr

Every OrderSide, in declaration order.

Definition at line 1689 of file types.hpp.

◆ all_order_types

std::array<OrderType, 9> algotradelib::all_order_types
inlineconstexpr
Initial value:
{
OrderType::UNKNOWN,
}
@ LIMIT
지정가: fills at the stated price or better.
Definition types.hpp:1710
@ BEST_LIMIT
최유리지정가: priced at the best quote on the opposite side.
Definition types.hpp:1716
@ PRIMARY_LIMIT
최우선지정가: priced at the best quote on the order's own side.
Definition types.hpp:1718
@ CONDITIONAL_LIMIT
조건부지정가: a limit that becomes a market order at the close.
Definition types.hpp:1714
@ MID_PRICE
중간가: priced at the midpoint of the spread.
Definition types.hpp:1720
@ STOP_LIMIT
스톱지정가: a limit released when a trigger price is reached.
Definition types.hpp:1722
@ CLOSING_PRICE
시간외종가: priced at a session's closing price.
Definition types.hpp:1724
@ MARKET
시장가: fills at whatever the book offers.
Definition types.hpp:1712

Every OrderType, in declaration order.

Definition at line 1728 of file types.hpp.

◆ all_times_in_force

std::array<TimeInForce, 4> algotradelib::all_times_in_force
inlineconstexpr
Initial value:
{
TimeInForce::UNKNOWN,
}
@ FILL_OR_KILL
Fills entirely and immediately, or not at all.
Definition types.hpp:1804
@ DAY
Rests until the session ends; an unfilled remainder is cancelled then.
Definition types.hpp:1800
@ IMMEDIATE_OR_CANCEL
Fills what it can immediately and cancels the remainder.
Definition types.hpp:1802

Every TimeInForce, in declaration order.

Definition at line 1808 of file types.hpp.

◆ all_venues

std::array<Venue, 4> algotradelib::all_venues {Venue::UNSPECIFIED, Venue::KRX, Venue::NXT, Venue::COMBINED}
inlineconstexpr

Every Venue, in declaration order.

Definition at line 51 of file types.hpp.