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

The state of one order, as a broker listing reported it. More...

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

Collaboration diagram for algotradelib::OrderSnapshot:

Public Attributes

std::string order_id_
 The broker's order number.
InstrumentId instrument_
 The instrument (identity venue; the routing venue is venue_).
std::string name_
 The instrument's name as the broker spells it.
OrderSide side_ {OrderSide::BUY}
 Buy or sell.
OrderType type_ {OrderType::UNKNOWN}
 The price basis; UNKNOWN if the broker's code was not recognized.
TimeInForce time_in_force_ {TimeInForce::UNKNOWN}
 The time in force; UNKNOWN if the broker's code was not recognized.
OrderSession session_ {OrderSession::UNKNOWN}
 The session; UNKNOWN if the broker's code was not recognized.
Venue venue_ {Venue::UNSPECIFIED}
 Where the broker says the order was routed; UNSPECIFIED if it does not say.
Code< 8 > shape_code_
 The broker's own order-type code, verbatim (KIS two digits, Toss three letters).
OrderStatus status_ {OrderStatus::UNKNOWN}
 The status; UNKNOWN where the broker publishes none.
std::optional< Decimal64 > price_
 The limit price, if the order has one.
std::optional< Decimal64 > trigger_price_
 The trigger price, whenever the broker reports a positive one.
Decimal64 quantity_
 The quantity ordered; the remainder is this minus execution_.filled_quantity_.
std::optional< Decimal64 > order_amount_
 The money an amount-based order committed (Toss US market orders), if any.
Currency currency_
 The currency of the row's prices and amounts.
std::optional< std::chrono::system_clock::time_point > ordered_at_
 When the broker recorded the order, if it gives a time. KIS's real-server working orders have none; on a demo account they carry the history's order time.
bool ordered_date_assumed_ {false}
 Whether the broker stated only the time of day, and the date in ordered_at_ is the day the adapter read the row (a Kiwoom working order). Such a row is no evidence of the day it was placed.
std::optional< std::chrono::system_clock::time_point > canceled_at_
 When the order was cancelled, if the broker reports it.
OrderExecution execution_
 What has filled and what it cost; see OrderExecution before testing a fill.

Detailed Description

The state of one order, as a broker listing reported it.

Definition at line 2008 of file types.hpp.

Member Data Documentation

◆ canceled_at_

std::optional<std::chrono::system_clock::time_point> algotradelib::OrderSnapshot::canceled_at_

When the order was cancelled, if the broker reports it.

Definition at line 2072 of file types.hpp.

◆ currency_

Currency algotradelib::OrderSnapshot::currency_

The currency of the row's prices and amounts.

Definition at line 2060 of file types.hpp.

◆ execution_

OrderExecution algotradelib::OrderSnapshot::execution_

What has filled and what it cost; see OrderExecution before testing a fill.

Definition at line 2074 of file types.hpp.

◆ instrument_

◆ name_

std::string algotradelib::OrderSnapshot::name_

The instrument's name as the broker spells it.

Definition at line 2014 of file types.hpp.

◆ order_amount_

std::optional<Decimal64> algotradelib::OrderSnapshot::order_amount_

The money an amount-based order committed (Toss US market orders), if any.

The library does not place such orders, but reports ones placed elsewhere. Toss can state the amount with more digits than Decimal64 holds; it is then rounded half to even to 18 significant digits.

Definition at line 2058 of file types.hpp.

◆ order_id_

◆ ordered_at_

std::optional<std::chrono::system_clock::time_point> algotradelib::OrderSnapshot::ordered_at_

When the broker recorded the order, if it gives a time. KIS's real-server working orders have none; on a demo account they carry the history's order time.

Definition at line 2065 of file types.hpp.

Referenced by algotradelib::runner::dates_listed_order(), algotradelib::runner::exact_copy(), and algotradelib::runner::time_evidence().

◆ ordered_date_assumed_

bool algotradelib::OrderSnapshot::ordered_date_assumed_ {false}

Whether the broker stated only the time of day, and the date in ordered_at_ is the day the adapter read the row (a Kiwoom working order). Such a row is no evidence of the day it was placed.

Definition at line 2070 of file types.hpp.

Referenced by algotradelib::runner::dates_listed_order(), and algotradelib::runner::time_evidence().

◆ price_

◆ quantity_

Decimal64 algotradelib::OrderSnapshot::quantity_

◆ session_

OrderSession algotradelib::OrderSnapshot::session_ {OrderSession::UNKNOWN}

◆ shape_code_

Code<8> algotradelib::OrderSnapshot::shape_code_

The broker's own order-type code, verbatim (KIS two digits, Toss three letters).

Kept even when the normalized fields read UNKNOWN. Empty if the broker sent none, or a code longer than eight characters or with characters other than A-Z, 0-9, _.

Definition at line 2036 of file types.hpp.

◆ side_

◆ status_

OrderStatus algotradelib::OrderSnapshot::status_ {OrderStatus::UNKNOWN}

The status; UNKNOWN where the broker publishes none.

Definition at line 2038 of file types.hpp.

◆ time_in_force_

TimeInForce algotradelib::OrderSnapshot::time_in_force_ {TimeInForce::UNKNOWN}

◆ trigger_price_

std::optional<Decimal64> algotradelib::OrderSnapshot::trigger_price_

The trigger price, whenever the broker reports a positive one.

Kept even on a row whose type is not STOP_LIMIT (a broker contradiction); replacing such an order is then refused, while cancelling it works. Empty on a stop row means the broker did not say, and replacing it is refused.

Definition at line 2048 of file types.hpp.

Referenced by algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::cancel(), algotradelib::cancel_all(), algotradelib::cancel_quantity(), algotradelib::runner::dates_listed_order(), algotradelib::strategy::is_stop_order(), algotradelib::resting_shape(), algotradelib::runner::row_corresponds(), and algotradelib::runner::row_might_correspond().

◆ type_

◆ venue_

Venue algotradelib::OrderSnapshot::venue_ {Venue::UNSPECIFIED}

Where the broker says the order was routed; UNSPECIFIED if it does not say.

An amendment must address this venue. It is kept apart from instrument_ so the order still matches its holding, which brokers report without a venue.

Definition at line 2029 of file types.hpp.

Referenced by algotradelib::cancel_all(), algotradelib::cancel_quantity(), algotradelib::runner::dates_listed_order(), algotradelib::replace_with(), and algotradelib::runner::route_evidence().


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