![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
An order to place, in broker-neutral form. More...
#include <algotradelib/src/core/types.hpp>
Public Attributes | |
| InstrumentId | instrument_ |
| The instrument; its venue_ is identity, and routing is this struct's venue_. | |
| OrderSide | side_ {OrderSide::BUY} |
| Buy or sell. | |
| OrderType | type_ {OrderType::LIMIT} |
| The price basis: limit, market, best-limit, and so on. | |
| TimeInForce | time_in_force_ {TimeInForce::DAY} |
| How long the order stays valid. | |
| OrderSession | session_ {OrderSession::REGULAR} |
| The trading session. | |
| Venue | venue_ {Venue::UNSPECIFIED} |
| Where to route the order, if the broker offers a choice. | |
| Decimal64 | quantity_ |
| The quantity, in the instrument's units (shares). | |
| std::optional< Decimal64 > | price_ |
| The price; required when carries_caller_price(type_), refused otherwise. | |
| std::optional< Decimal64 > | trigger_price_ |
| The trigger price; required for STOP_LIMIT, refused otherwise. | |
| std::optional< std::string > | client_order_id_ |
| An idempotency key, if the broker offers one; never generated by the library. | |
| bool | confirm_high_value_ {false} |
| Confirms a high-value order, where the broker asks for that confirmation. | |
An order to place, in broker-neutral form.
price_ must be set exactly when carries_caller_price(type_), and trigger_price_ exactly for STOP_LIMIT. An UNKNOWN type, time in force or session, or a combination the broker does not offer at the requested venue, is refused before any I/O.
| std::optional<std::string> algotradelib::OrderRequest::client_order_id_ |
An idempotency key, if the broker offers one; never generated by the library.
Toss honours one for ten minutes. KIS has none for individual customers and refuses a request that carries one, before any I/O.
Definition at line 1966 of file types.hpp.
Referenced by algotradelib::live::SessionExecutor< Session >::place(), algotradelib::kis::unsupported_client_order_id(), and algotradelib::kiwoom::unsupported_client_order_id().
| bool algotradelib::OrderRequest::confirm_high_value_ {false} |
| InstrumentId algotradelib::OrderRequest::instrument_ |
The instrument; its venue_ is identity, and routing is this struct's venue_.
Definition at line 1927 of file types.hpp.
Referenced by algotradelib::live::SessionExecutor< Session >::place().
| std::optional<Decimal64> algotradelib::OrderRequest::price_ |
The price; required when carries_caller_price(type_), refused otherwise.
Definition at line 1952 of file types.hpp.
Referenced by algotradelib::live::SessionExecutor< Session >::place().
| Decimal64 algotradelib::OrderRequest::quantity_ |
The quantity, in the instrument's units (shares).
Definition at line 1950 of file types.hpp.
Referenced by algotradelib::live::SessionExecutor< Session >::place().
| OrderSession algotradelib::OrderRequest::session_ {OrderSession::REGULAR} |
The trading session.
Definition at line 1935 of file types.hpp.
Referenced by algotradelib::live::SessionExecutor< Session >::place().
| OrderSide algotradelib::OrderRequest::side_ {OrderSide::BUY} |
Buy or sell.
Definition at line 1929 of file types.hpp.
Referenced by algotradelib::live::SessionExecutor< Session >::place().
| TimeInForce algotradelib::OrderRequest::time_in_force_ {TimeInForce::DAY} |
How long the order stays valid.
Definition at line 1933 of file types.hpp.
Referenced by algotradelib::live::SessionExecutor< Session >::place().
| std::optional<Decimal64> algotradelib::OrderRequest::trigger_price_ |
The trigger price; required for STOP_LIMIT, refused otherwise.
A broker whose BrokerCaps::has_trigger_price is false never receives one: BrokerSession refuses the request first.
Definition at line 1959 of file types.hpp.
Referenced by algotradelib::live::SessionExecutor< Session >::place().
| OrderType algotradelib::OrderRequest::type_ {OrderType::LIMIT} |
The price basis: limit, market, best-limit, and so on.
Definition at line 1931 of file types.hpp.
Referenced by algotradelib::live::SessionExecutor< Session >::place().
| Venue algotradelib::OrderRequest::venue_ {Venue::UNSPECIFIED} |
Where to route the order, if the broker offers a choice.
Set routing here, not in instrument_.venue_ (an adapter refuses an identity venue other than the one it reports). UNSPECIFIED takes the broker's default:
A live runner sets it from live::SessionExecutor::default_route.
Definition at line 1948 of file types.hpp.
Referenced by algotradelib::live::SessionExecutor< Session >::place().