![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
The Korea Investment & Securities (KIS) Open API client. More...
Classes | |
| struct | Broker |
| The KIS broker tag: order references are typed by it, so a KIS reference works with both KIS clients and with no other broker. More... | |
| struct | KisAccount |
| A KIS account: the account number and product code every account request names. More... | |
| struct | KisAmendment |
| An amendment or cancellation of a KIS order. More... | |
| class | KisAuth |
| Obtains and caches KIS access tokens and WebSocket approval keys with blocking requests; thread-safe. More... | |
| class | KisBlockingClient |
| A blocking KIS client: each call runs a KisClient request on a private event loop and returns its result. Not thread-safe. More... | |
| class | KisClient |
| The asynchronous KIS REST client: market data, account inquiries and orders for domestic stocks. More... | |
| struct | KisConfig |
| KIS credentials (app key and secret), demo or real account, and the market-data tape. More... | |
| struct | KisHistoryRange |
| The date range of a KIS order-history inquiry, both ends included (Korean dates). More... | |
| struct | KisOpenOrder |
| A KIS order that can still be amended or cancelled. More... | |
| struct | KisOpenOrderPage |
| KIS's list of orders that can still be amended or cancelled. More... | |
| struct | KisOrderAck |
| KIS's acknowledgement of an accepted order, amendment or cancellation. More... | |
| struct | KisOrderRef |
| A KIS order's address: branch number and order number, both kept. More... | |
| struct | KisRest |
| A KIS REST access token and its expiry. More... | |
| struct | KisWebsocket |
| A KIS WebSocket approval key and when it was issued. More... | |
Typedefs | |
| using | KisHttpClient = network::HttpClient |
| The blocking HTTP client KisAuth uses. | |
Enumerations | |
| enum class | KisRateLimitLayer { NONE , LEDGER , PERSONAL } |
| Which of KIS's two request-rate limits a refusal reports. More... | |
| enum class | MarketTape { CONSOLIDATED , KRX , NXT } |
| Which venue's prices KIS market-data requests read (see KisConfig::market_tape_). More... | |
Functions | |
| Date | today_in_seoul () |
| Returns today's date in Korea (UTC+9), the date KIS requests are made in. | |
| KisRateLimitLayer | kis_rate_limit_layer (std::string_view code) |
| Classifies a KIS error code as a rate-limit refusal. | |
| std::optional< BrokerError > | unsupported_client_order_id (const OrderRequest &order) |
| Refuses an idempotency key, which KIS does not offer to individual customers. | |
| constexpr bool | publishes_bar_interval (BarInterval interval) noexcept |
| Tests whether KIS publishes a chart at an interval. | |
| std::optional< BrokerError > | unsupported_bar_interval (BarInterval interval) |
| Refuses a bar interval KIS publishes no chart for (publishes_bar_interval). | |
| constexpr const char * | market_division_code (MarketTape tape) noexcept |
| Returns KIS's FID_COND_MRKT_DIV_CODE for a tape. | |
| static std::chrono::system_clock::time_point | parse_expiry (const char *s) |
| Reads KIS's token expiry, YYYY-MM-DD HH:MM:SS in Korean time. | |
The Korea Investment & Securities (KIS) Open API client.
The blocking HTTP client KisAuth uses.
Definition at line 9 of file network.hpp.
|
strong |
Which of KIS's two request-rate limits a refusal reports.
Definition at line 219 of file client.hpp.
|
strong |
Which venue's prices KIS market-data requests read (see KisConfig::market_tape_).
| Enumerator | |
|---|---|
| CONSOLIDATED | KRX and NXT combined (UN). |
| KRX | KRX alone (J). |
| NXT | NXT alone (NX). |
Definition at line 25 of file config.hpp.
|
inline |
Classifies a KIS error code as a rate-limit refusal.
EGW00317 (an endpoint closed for a scheduled window) is not a rate limit.
| code | KIS's message code. |
Definition at line 239 of file client.hpp.
Referenced by kis_rate_limit_layer().
|
inlineconstexprnoexcept |
Returns KIS's FID_COND_MRKT_DIV_CODE for a tape.
| tape | The tape. |
Definition at line 39 of file config.hpp.
Referenced by market_division_code().
|
inlinestatic |
Reads KIS's token expiry, YYYY-MM-DD HH:MM:SS in Korean time.
| s | The text. |
Definition at line 58 of file config.hpp.
Referenced by algotradelib::kis::KisRest::from_json_impl(), and parse_expiry().
|
inlineconstexprnoexcept |
Tests whether KIS publishes a chart at an interval.
| interval | The interval. |
Definition at line 277 of file client.hpp.
Referenced by publishes_bar_interval(), and unsupported_bar_interval().
|
inline |
Returns today's date in Korea (UTC+9), the date KIS requests are made in.
Definition at line 200 of file client.hpp.
Referenced by algotradelib::BrokerTraits< kis::KisBlockingClient >::calendar(), algotradelib::BrokerTraits< kis::KisClient >::calendar(), and today_in_seoul().
|
inline |
Refuses a bar interval KIS publishes no chart for (publishes_bar_interval).
| interval | The interval. |
Definition at line 299 of file client.hpp.
Referenced by unsupported_bar_interval().
|
inline |
Refuses an idempotency key, which KIS does not offer to individual customers.
Without one, resending after a transport failure can place a second order, so an order carrying client_order_id_ is refused before sending rather than sent without it. confirm_high_value_ is accepted (and ignored).
| order | The order. |
Definition at line 257 of file client.hpp.
Referenced by unsupported_client_order_id().