![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
Blocking facade that drives TossClient on a private event loop. More...
#include <algotradelib/src/brokers/tossinvest/client.hpp>
Public Member Functions | |
| TossBlockingClient (ssl::context &context, TossConfig config, network::HttpClientOptions options={}) | |
| Constructs a blocking Toss Securities client. | |
| Result< QuoteSnapshot > | quote (InstrumentId instrument) |
| Returns a quote for a Korean instrument (a US instrument is refused; use prices). | |
| Result< std::vector< TossAccount > > | accounts () |
| Discovers the brokerage accounts available to the current credentials. | |
| Result< Instrument > | instrument (InstrumentId subject) |
| Returns static reference data for one instrument. | |
| Result< TradingCalendar > | calendar (Country country, std::optional< Date > from=std::nullopt) |
| Returns the trading calendar around from for one market. | |
| Result< PriceLimits > | price_limits (InstrumentId instrument) |
| Returns today's upper and lower price bound. | |
| Result< std::vector< TradePrint > > | trades (InstrumentId instrument, int count) |
| Returns recent executions for one instrument. | |
| Result< std::vector< QuoteSnapshot > > | prices (std::vector< InstrumentId > instruments) |
| Returns a quote for every instrument in one request. | |
| Result< DepthSnapshot > | depth (InstrumentId instrument) |
| Returns the resting orders on both sides of the book. | |
| Result< BarSeries > | bars (BarQuery query) |
| Returns up to count_ bars; see TossClient::async_bars. | |
| Result< HoldingsSnapshot > | holdings (std::int64_t account_sequence) |
| Returns normalized positions and per-currency totals for one account. | |
| Result< BuyingPower > | buying_power (Currency currency, std::int64_t account_sequence) |
| Returns what the account may spend in currency. | |
| Result< Decimal64 > | sellable_quantity (InstrumentId instrument, std::int64_t account_sequence) |
| Returns how much of instrument the account may sell. | |
| Result< CommissionSchedule > | commissions (std::int64_t account_sequence) |
| Returns the commission rates in force for the account. | |
| Result< OrderAck > | place_order (std::int64_t account_sequence, OrderRequest order) |
| Places an order; see TossClient::async_place_order. | |
| Result< OrderAck > | replace_order (std::int64_t account_sequence, TossAmendment amendment) |
| Amends an open order; the outcome can be unknown after an error. The acknowledgement carries a new id; see TossClient::async_replace_order. | |
| Result< OrderAck > | cancel_order (std::int64_t account_sequence, std::string order_id) |
| Cancels an open order; the outcome can be unknown after an error. The acknowledgement carries a new id; see TossClient::async_cancel_order. | |
| Result< OrderPage > | orders (TossOrderQuery query) |
| Returns one page of orders; see TossClient::async_orders for which orders are listed. | |
| Result< OrderSnapshot > | order (std::int64_t account_sequence, std::string order_id) |
| Returns one order by id; see TossClient::async_order for which orders can be read. | |
| const network::RateLimitStats * | rate_limit_stats () const |
| Returns the rate limiter's statistics (safe to read between calls). | |
Blocking facade that drives TossClient on a private event loop.
Definition at line 3994 of file client.hpp.
|
inline |
Constructs a blocking Toss Securities client.
| context | The TLS context; borrowed, and must outlive the client. |
| config | The credentials. |
| options | HTTP options. |
Definition at line 4002 of file client.hpp.
|
inline |
Discovers the brokerage accounts available to the current credentials.
Definition at line 4027 of file client.hpp.
Referenced by algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::accounts().
Returns up to count_ bars; see TossClient::async_bars.
| query | The query. |
Definition at line 4115 of file client.hpp.
Referenced by algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::bars().
|
inline |
Returns what the account may spend in currency.
| currency | The currency. |
| account_sequence | The account (TossAccount::sequence_). |
Definition at line 4140 of file client.hpp.
Referenced by algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::buying_power().
|
inline |
Returns the trading calendar around from for one market.
| country | The market. |
| from | The date (empty: Toss's today). |
Definition at line 4052 of file client.hpp.
Referenced by algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::calendar().
|
inline |
Cancels an open order; the outcome can be unknown after an error. The acknowledgement carries a new id; see TossClient::async_cancel_order.
| account_sequence | The account (TossAccount::sequence_). |
| order_id | Toss's order id. |
Definition at line 4219 of file client.hpp.
Referenced by algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::cancel_order().
|
inline |
Returns the commission rates in force for the account.
| account_sequence | The account (TossAccount::sequence_). |
Definition at line 4169 of file client.hpp.
Referenced by algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::commissions().
|
inline |
Returns the resting orders on both sides of the book.
| instrument | The instrument. |
Definition at line 4103 of file client.hpp.
Referenced by algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::depth().
|
inline |
Returns normalized positions and per-currency totals for one account.
| account_sequence | The account (TossAccount::sequence_). |
Definition at line 4127 of file client.hpp.
Referenced by algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::holdings().
|
inline |
Returns static reference data for one instrument.
| subject | The instrument. |
Definition at line 4039 of file client.hpp.
Referenced by depth(), algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::instrument(), price_limits(), quote(), sellable_quantity(), and trades().
|
inline |
Returns one order by id; see TossClient::async_order for which orders can be read.
| account_sequence | The account (TossAccount::sequence_). |
| order_id | Toss's order id. |
Definition at line 4246 of file client.hpp.
Referenced by algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::order_by_id(), and place_order().
|
inline |
Returns one page of orders; see TossClient::async_orders for which orders are listed.
| query | The query. |
Definition at line 4233 of file client.hpp.
Referenced by algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::order_history(), and algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::working_orders().
|
inline |
Places an order; see TossClient::async_place_order.
The outcome can be unknown after an error (see TossClient::async_place_order). With client_order_id_ set, sending the same order again within ten minutes is safe; without one, read orders() before placing again.
| account_sequence | The account (TossAccount::sequence_). |
| order | The order. |
Definition at line 4187 of file client.hpp.
Referenced by algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::place_order().
|
inline |
Returns today's upper and lower price bound.
| instrument | The instrument. |
Definition at line 4064 of file client.hpp.
Referenced by algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::price_limits().
|
inline |
Returns a quote for every instrument in one request.
| instruments | The instruments. |
Definition at line 4091 of file client.hpp.
Referenced by algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::prices().
|
inline |
Returns a quote for a Korean instrument (a US instrument is refused; use prices).
| instrument | The instrument. |
Definition at line 4016 of file client.hpp.
Referenced by algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::quote().
|
inline |
Returns the rate limiter's statistics (safe to read between calls).
Definition at line 4259 of file client.hpp.
Referenced by algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::rate_limit_stats().
|
inline |
Amends an open order; the outcome can be unknown after an error. The acknowledgement carries a new id; see TossClient::async_replace_order.
| account_sequence | The account (TossAccount::sequence_). |
| amendment | The amendment. |
Definition at line 4203 of file client.hpp.
Referenced by algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::replace_order().
|
inline |
Returns how much of instrument the account may sell.
| instrument | The instrument. |
| account_sequence | The account (TossAccount::sequence_). |
Definition at line 4155 of file client.hpp.
Referenced by algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::sellable_quantity().
|
inline |
Returns recent executions for one instrument.
| instrument | The instrument. |
| count | The most trades to return, clamped to 1-50 (today's trades only). |
Definition at line 4077 of file client.hpp.
Referenced by algotradelib::BrokerTraits< tossinvest::TossBlockingClient >::trades().