![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
A blocking Kiwoom client: each call runs a KiwoomClient request on a private event loop and returns its result. Not thread-safe. Order references work with either client. More...
#include <algotradelib/src/brokers/kiwoom/client.hpp>
Public Member Functions | |
| KiwoomBlockingClient (ssl::context &context, KiwoomConfig config, network::HttpClientOptions options={}) | |
| Constructs a client. | |
| Result< QuoteSnapshot > | quote (InstrumentId instrument) |
| Returns the current normalized quote or a structured error. | |
| Result< PriceLimits > | price_limits (InstrumentId instrument) |
| Returns today's upper and lower price bound. | |
| Result< DepthSnapshot > | depth (InstrumentId instrument) |
| Returns the resting orders on both sides of the book. | |
| Result< std::vector< TradePrint > > | trades (InstrumentId instrument, int count) |
| Returns recent executions, newest first. | |
| Result< Instrument > | instrument (InstrumentId subject) |
| Returns static reference data for one instrument. | |
| Result< BarSeries > | bars (BarQuery query) |
| Returns bars; see KiwoomClient::async_bars. | |
| const KiwoomConfig & | config () const noexcept |
| Returns the configuration; see KiwoomClient::config. | |
| Result< HoldingsSnapshot > | holdings (KiwoomAccount account) |
| Returns the holdings for KiwoomConfig::holdings_venue_; see KiwoomClient::async_holdings. | |
| Result< BuyingPower > | buying_power (Currency currency, KiwoomAccount account) |
| Returns what the bound credential's account may spend. | |
| Result< KiwoomDeposit > | deposit () |
| Returns Kiwoom's own fuller deposit detail. | |
| Result< KiwoomOrderableAmount > | orderable_amount (InstrumentId instrument, OrderSide side, std::optional< Decimal64 > price=std::nullopt) |
| Returns what may be ordered of one instrument, per margin tier. | |
| Result< std::vector< KiwoomAccountInfo > > | accounts () |
| Returns the one account the bound credential drives. | |
| Result< KiwoomOrderAck > | place_order (KiwoomAccount account, OrderRequest order) |
| Submits a new order. The outcome can be unknown after an error; see KiwoomClient::async_place_order. | |
| Result< KiwoomOrderAck > | replace_order (KiwoomAccount account, KiwoomAmendment amendment) |
| Modifies an existing order. The outcome can be unknown after an error; see KiwoomClient::async_replace_order. | |
| Result< KiwoomOrderAck > | cancel_order (KiwoomAccount account, KiwoomAmendment amendment) |
| Cancels an existing order. The outcome can be unknown after an error; see KiwoomClient::async_cancel_order. | |
| Result< KiwoomOpenOrderPage > | open_orders (KiwoomAccount account) |
| Returns every order still open to amendment. | |
| Result< OrderPage > | order_history (KiwoomAccount account, KiwoomHistoryQuery query) |
| Returns one day of order history. | |
| void | close () |
| Closes the client for good; see KiwoomClient::close. | |
| const network::RateLimitStats * | rate_limit_stats () const |
| Returns the rate limiter's statistics. | |
A blocking Kiwoom client: each call runs a KiwoomClient request on a private event loop and returns its result. Not thread-safe. Order references work with either client.
A call whose loop stops before the request completes returns a TRANSPORT error (event_loop_stopped).
Definition at line 3795 of file client.hpp.
|
inline |
Constructs a client.
| context | The TLS context; borrowed, and must outlive the client. |
| config | The credentials and environment. |
| options | HTTP options. |
Definition at line 3803 of file client.hpp.
|
inline |
Returns the one account the bound credential drives.
Definition at line 3953 of file client.hpp.
Referenced by algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::accounts().
Returns bars; see KiwoomClient::async_bars.
| query | The query. |
Definition at line 3878 of file client.hpp.
Referenced by algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::bars().
|
inline |
Returns what the bound credential's account may spend.
| currency | The currency; anything but KRW is refused before sending. |
| account | The bound account. |
Definition at line 3909 of file client.hpp.
Referenced by algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::buying_power().
|
inline |
Cancels an existing order. The outcome can be unknown after an error; see KiwoomClient::async_cancel_order.
| account | The bound account. |
| amendment | The amendment. |
Definition at line 3999 of file client.hpp.
Referenced by algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::cancel_order().
|
inline |
Closes the client for good; see KiwoomClient::close.
Definition at line 4036 of file client.hpp.
|
inlinenoexcept |
Returns the configuration; see KiwoomClient::config.
Definition at line 3889 of file client.hpp.
Referenced by algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::holdings(), and KiwoomBlockingClient().
|
inline |
Returns Kiwoom's own fuller deposit detail.
Definition at line 3920 of file client.hpp.
|
inline |
Returns the resting orders on both sides of the book.
| instrument | The instrument. |
Definition at line 3841 of file client.hpp.
Referenced by algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::depth().
|
inline |
Returns the holdings for KiwoomConfig::holdings_venue_; see KiwoomClient::async_holdings.
| account | The account (empty). |
Definition at line 3896 of file client.hpp.
Referenced by algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::holdings().
|
inline |
Returns static reference data for one instrument.
| subject | The instrument. |
Definition at line 3866 of file client.hpp.
Referenced by depth(), algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::instrument(), orderable_amount(), price_limits(), quote(), and trades().
|
inline |
Returns every order still open to amendment.
| account | The bound account. |
Definition at line 4013 of file client.hpp.
Referenced by algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::working_orders().
|
inline |
Returns one day of order history.
| account | The bound account. |
| query | The query. |
Definition at line 4026 of file client.hpp.
Referenced by algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::order_history().
|
inline |
Returns what may be ordered of one instrument, per margin tier.
| instrument | The instrument. |
| side | The side. |
| price | The unit price to evaluate at (uv), or empty to send none. |
Definition at line 3934 of file client.hpp.
|
inline |
Submits a new order. The outcome can be unknown after an error; see KiwoomClient::async_place_order.
| account | The bound account. |
| order | The order. |
Definition at line 3967 of file client.hpp.
Referenced by algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::place_order().
|
inline |
Returns today's upper and lower price bound.
| instrument | The instrument. |
Definition at line 3829 of file client.hpp.
Referenced by algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::price_limits().
|
inline |
Returns the current normalized quote or a structured error.
| instrument | The instrument. |
Definition at line 3817 of file client.hpp.
Referenced by algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::quote().
|
inline |
Returns the rate limiter's statistics.
Read them on the client's strand or while no request is in progress (between calls on the blocking client).
Definition at line 4046 of file client.hpp.
Referenced by algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::rate_limit_stats().
|
inline |
Modifies an existing order. The outcome can be unknown after an error; see KiwoomClient::async_replace_order.
| account | The bound account. |
| amendment | The amendment. |
Definition at line 3983 of file client.hpp.
Referenced by algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::replace_order().
|
inline |
Returns recent executions, newest first.
| instrument | The instrument. |
| count | The most trades to return. |
Definition at line 3854 of file client.hpp.
Referenced by algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::trades().