![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
The state of one order, as a broker listing reported it. More...
#include <algotradelib/src/core/types.hpp>
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. | |
| std::optional<std::chrono::system_clock::time_point> algotradelib::OrderSnapshot::canceled_at_ |
| Currency algotradelib::OrderSnapshot::currency_ |
| OrderExecution algotradelib::OrderSnapshot::execution_ |
What has filled and what it cost; see OrderExecution before testing a fill.
| InstrumentId algotradelib::OrderSnapshot::instrument_ |
The instrument (identity venue; the routing venue is venue_).
Definition at line 2012 of file types.hpp.
Referenced by algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::cancel(), algotradelib::runner::dates_listed_order(), algotradelib::runner::exact_copy(), algotradelib::runner::row_corresponds(), and algotradelib::runner::row_might_correspond().
| std::string algotradelib::OrderSnapshot::name_ |
| 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.
| std::string algotradelib::OrderSnapshot::order_id_ |
The broker's order number.
Definition at line 2010 of file types.hpp.
Referenced by algotradelib::runner::dates_listed_order(), algotradelib::runner::exact_copy(), algotradelib::runner::recorded_owner(), and algotradelib::runner::Runner< Strategy, CapsType, Tag, Executor >::withdrawal_accepted_for().
| 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().
| 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().
| std::optional<Decimal64> algotradelib::OrderSnapshot::price_ |
The limit price, if the order has one.
Definition at line 2040 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::resting_shape(), algotradelib::runner::row_corresponds(), and algotradelib::runner::row_might_correspond().
| Decimal64 algotradelib::OrderSnapshot::quantity_ |
The quantity ordered; the remainder is this minus execution_.filled_quantity_.
Definition at line 2050 of file types.hpp.
Referenced by algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::cancel(), algotradelib::runner::dates_listed_order(), algotradelib::runner::row_corresponds(), and algotradelib::runner::row_might_correspond().
| OrderSession algotradelib::OrderSnapshot::session_ {OrderSession::UNKNOWN} |
The session; UNKNOWN if the broker's code was not recognized.
Definition at line 2022 of file types.hpp.
Referenced by algotradelib::cancel_all(), algotradelib::cancel_quantity(), algotradelib::runner::dates_listed_order(), algotradelib::resting_shape(), algotradelib::runner::row_corresponds(), and algotradelib::runner::row_might_correspond().
| Code<8> algotradelib::OrderSnapshot::shape_code_ |
| OrderSide algotradelib::OrderSnapshot::side_ {OrderSide::BUY} |
Buy or sell.
Definition at line 2016 of file types.hpp.
Referenced by algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::cancel(), algotradelib::runner::dates_listed_order(), algotradelib::runner::row_corresponds(), and algotradelib::runner::row_might_correspond().
| OrderStatus algotradelib::OrderSnapshot::status_ {OrderStatus::UNKNOWN} |
| TimeInForce algotradelib::OrderSnapshot::time_in_force_ {TimeInForce::UNKNOWN} |
The time in force; UNKNOWN if the broker's code was not recognized.
Definition at line 2020 of file types.hpp.
Referenced by algotradelib::cancel_all(), algotradelib::cancel_quantity(), algotradelib::runner::dates_listed_order(), algotradelib::resting_shape(), algotradelib::runner::row_corresponds(), and algotradelib::runner::row_might_correspond().
| 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().
| OrderType algotradelib::OrderSnapshot::type_ {OrderType::UNKNOWN} |
The price basis; UNKNOWN if the broker's code was not recognized.
Definition at line 2018 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().
| 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().