algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::BrokerTraits< kiwoom::KiwoomClient > Struct Reference

The BrokerSession adapter for kiwoom::KiwoomClient. More...

#include <algotradelib/src/brokers/kiwoom/traits.hpp>

Inheritance diagram for algotradelib::BrokerTraits< kiwoom::KiwoomClient >:
Collaboration diagram for algotradelib::BrokerTraits< kiwoom::KiwoomClient >:

Public Types

using Client = kiwoom::KiwoomClient
 The client type.
using Config = kiwoom::KiwoomConfig
 Kiwoom application credentials and environment selection.
using Account = kiwoom::KiwoomAccount
 Kiwoom account selector, which carries nothing because Kiwoom takes nothing.
using AccountListItem = kiwoom::KiwoomAccountInfo
 Item type of the broker's own account listing.
using BrokerTag = kiwoom::Broker
 The broker tag.
using PlaceAck = kiwoom::KiwoomOrderAck
 Acknowledgement Kiwoom returns for an order instruction.
using Amendment = kiwoom::KiwoomAmendment
 Kiwoom modification and cancellation instruction.
using HistoryQuery = kiwoom::KiwoomHistoryQuery
 Kiwoom order-history selector.
using WorkingOrdersResult = kiwoom::KiwoomOpenOrderPage
 Kiwoom amendable-order result.

Static Public Member Functions

static constexpr Venue effective_route (Venue asked) noexcept
 Returns the venue an order reaches; see kiwoom_route.
static const network::RateLimitStats * rate_limit_stats (const Client &client)
 Returns the rate limiter's statistics.
template<typename Token>
static auto quote (Client &client, InstrumentId instrument, Token &&token)
 Forwards a quote request.
template<typename Token>
static auto price_limits (Client &client, InstrumentId instrument, Token &&token)
 Forwards a price-bound request.
template<typename Token>
static auto trades (Client &client, InstrumentId instrument, int count, Token &&token)
 Forwards a recent-execution request.
template<typename Token>
static auto depth (Client &client, InstrumentId instrument, Token &&token)
 Forwards an order book request.
template<typename Token>
static auto bars (Client &client, BarQuery query, Token &&token)
 Forwards a bar request.
template<typename Token>
static auto instrument (Client &client, InstrumentId subject, Token &&token)
 Forwards a reference-data request.
template<typename Token>
static auto accounts (Client &client, Token &&token)
 Forwards an account listing request.
template<typename Token>
static auto buying_power (Client &client, const Account &account, Currency currency, Token &&token)
 Forwards a buying-power request for the bound account.
template<typename Token>
static auto holdings (Client &client, const Account &account, Token &&token)
 Forwards a holdings request, or completes it with refuse_holdings() (sending nothing) while KiwoomConfig::holdings_position_scope_ is not stated.
template<typename Token>
static auto place_order (Client &client, const Account &account, OrderRequest order, Token &&token)
 Forwards an order submission for the bound account.
template<typename Token>
static auto replace_order (Client &client, const Account &account, Amendment amendment, Token &&token)
 Forwards an order modification for the bound account.
template<typename Token>
static auto cancel_order (Client &client, const Account &account, Amendment amendment, Token &&token)
 Forwards an order cancellation for the bound account.
template<typename Token>
static auto working_orders (Client &client, const Account &account, Token &&token)
 Forwards an amendable-order inquiry for the bound account.
template<typename Token>
static auto order_history (Client &client, const Account &account, HistoryQuery query, Token &&token)
 Forwards an order-history inquiry for the bound account.

Static Public Attributes

static constexpr std::string_view name = kiwoom::Broker::name
 The broker's name.
static constexpr bool blocking = false
 false: requests complete through a completion token.

Detailed Description

The BrokerSession adapter for kiwoom::KiwoomClient.

Definition at line 577 of file traits.hpp.

Member Typedef Documentation

◆ Account

Kiwoom account selector, which carries nothing because Kiwoom takes nothing.

Definition at line 593 of file traits.hpp.

◆ AccountListItem

Item type of the broker's own account listing.

Definition at line 596 of file traits.hpp.

◆ Amendment

Kiwoom modification and cancellation instruction.

Definition at line 605 of file traits.hpp.

◆ BrokerTag

The broker tag.

Definition at line 599 of file traits.hpp.

◆ Client

The client type.

Definition at line 587 of file traits.hpp.

◆ Config

Kiwoom application credentials and environment selection.

Definition at line 590 of file traits.hpp.

◆ HistoryQuery

Kiwoom order-history selector.

Definition at line 608 of file traits.hpp.

◆ PlaceAck

Acknowledgement Kiwoom returns for an order instruction.

Definition at line 602 of file traits.hpp.

◆ WorkingOrdersResult

Kiwoom amendable-order result.

Definition at line 611 of file traits.hpp.

Member Function Documentation

◆ accounts()

template<typename Token>
auto algotradelib::BrokerTraits< kiwoom::KiwoomClient >::accounts ( Client & client,
Token && token )
inlinestatic

Forwards an account listing request.

Template Parameters
TokenAn Asio completion token.
Parameters
clientThe client.
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 715 of file traits.hpp.

◆ bars()

template<typename Token>
auto algotradelib::BrokerTraits< kiwoom::KiwoomClient >::bars ( Client & client,
BarQuery query,
Token && token )
inlinestatic

Forwards a bar request.

Template Parameters
TokenAn Asio completion token.
Parameters
clientThe client.
queryThe query.
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 690 of file traits.hpp.

◆ buying_power()

template<typename Token>
auto algotradelib::BrokerTraits< kiwoom::KiwoomClient >::buying_power ( Client & client,
const Account & account,
Currency currency,
Token && token )
inlinestatic

Forwards a buying-power request for the bound account.

Template Parameters
TokenAn Asio completion token.
Parameters
clientThe client.
accountThe bound account.
currencyThe currency (only KRW is answered).
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 729 of file traits.hpp.

◆ cancel_order()

template<typename Token>
auto algotradelib::BrokerTraits< kiwoom::KiwoomClient >::cancel_order ( Client & client,
const Account & account,
Amendment amendment,
Token && token )
inlinestatic

Forwards an order cancellation for the bound account.

Template Parameters
TokenAn Asio completion token.
Parameters
clientThe client.
accountThe bound account.
amendmentThe amendment.
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 822 of file traits.hpp.

◆ depth()

template<typename Token>
auto algotradelib::BrokerTraits< kiwoom::KiwoomClient >::depth ( Client & client,
InstrumentId instrument,
Token && token )
inlinestatic

Forwards an order book request.

Template Parameters
TokenAn Asio completion token.
Parameters
clientThe client.
instrumentThe instrument.
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 677 of file traits.hpp.

◆ effective_route()

constexpr Venue algotradelib::BrokerTraits< kiwoom::KiwoomClient >::effective_route ( Venue asked)
inlinestaticconstexprnoexcept

Returns the venue an order reaches; see kiwoom_route.

Parameters
askedThe order's venue.
Returns
The venue.

Definition at line 584 of file traits.hpp.

◆ holdings()

template<typename Token>
auto algotradelib::BrokerTraits< kiwoom::KiwoomClient >::holdings ( Client & client,
const Account & account,
Token && token )
inlinestatic

Forwards a holdings request, or completes it with refuse_holdings() (sending nothing) while KiwoomConfig::holdings_position_scope_ is not stated.

The refusal completes on the handler's associated executor, like any other completion.

Template Parameters
TokenAn Asio completion token.
Parameters
clientThe client.
accountThe bound account.
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 751 of file traits.hpp.

◆ instrument()

template<typename Token>
auto algotradelib::BrokerTraits< kiwoom::KiwoomClient >::instrument ( Client & client,
InstrumentId subject,
Token && token )
inlinestatic

Forwards a reference-data request.

Template Parameters
TokenAn Asio completion token.
Parameters
clientThe client.
subjectThe instrument.
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 703 of file traits.hpp.

Referenced by depth(), price_limits(), quote(), and trades().

◆ order_history()

template<typename Token>
auto algotradelib::BrokerTraits< kiwoom::KiwoomClient >::order_history ( Client & client,
const Account & account,
HistoryQuery query,
Token && token )
inlinestatic

Forwards an order-history inquiry for the bound account.

Template Parameters
TokenAn Asio completion token.
Parameters
clientThe client.
accountThe bound account.
queryThe query.
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 854 of file traits.hpp.

◆ place_order()

template<typename Token>
auto algotradelib::BrokerTraits< kiwoom::KiwoomClient >::place_order ( Client & client,
const Account & account,
OrderRequest order,
Token && token )
inlinestatic

Forwards an order submission for the bound account.

Template Parameters
TokenAn Asio completion token.
Parameters
clientThe client.
accountThe bound account.
orderThe order.
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 784 of file traits.hpp.

◆ price_limits()

template<typename Token>
auto algotradelib::BrokerTraits< kiwoom::KiwoomClient >::price_limits ( Client & client,
InstrumentId instrument,
Token && token )
inlinestatic

Forwards a price-bound request.

Template Parameters
TokenAn Asio completion token.
Parameters
clientThe client.
instrumentThe instrument.
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 650 of file traits.hpp.

◆ quote()

template<typename Token>
auto algotradelib::BrokerTraits< kiwoom::KiwoomClient >::quote ( Client & client,
InstrumentId instrument,
Token && token )
inlinestatic

Forwards a quote request.

Template Parameters
TokenAn Asio completion token.
Parameters
clientThe client.
instrumentThe instrument.
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 637 of file traits.hpp.

◆ rate_limit_stats()

const network::RateLimitStats * algotradelib::BrokerTraits< kiwoom::KiwoomClient >::rate_limit_stats ( const Client & client)
inlinestatic

Returns the rate limiter's statistics.

Parameters
clientThe client.
Returns
The statistics, or null if the client has no rate-limit budget.

Definition at line 624 of file traits.hpp.

◆ replace_order()

template<typename Token>
auto algotradelib::BrokerTraits< kiwoom::KiwoomClient >::replace_order ( Client & client,
const Account & account,
Amendment amendment,
Token && token )
inlinestatic

Forwards an order modification for the bound account.

Template Parameters
TokenAn Asio completion token.
Parameters
clientThe client.
accountThe bound account.
amendmentThe amendment.
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 803 of file traits.hpp.

◆ trades()

template<typename Token>
auto algotradelib::BrokerTraits< kiwoom::KiwoomClient >::trades ( Client & client,
InstrumentId instrument,
int count,
Token && token )
inlinestatic

Forwards a recent-execution request.

Template Parameters
TokenAn Asio completion token.
Parameters
clientThe client.
instrumentThe instrument.
countThe most trades to return.
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 664 of file traits.hpp.

◆ working_orders()

template<typename Token>
auto algotradelib::BrokerTraits< kiwoom::KiwoomClient >::working_orders ( Client & client,
const Account & account,
Token && token )
inlinestatic

Forwards an amendable-order inquiry for the bound account.

Template Parameters
TokenAn Asio completion token.
Parameters
clientThe client.
accountThe bound account.
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 840 of file traits.hpp.

Member Data Documentation

◆ blocking

bool algotradelib::BrokerTraits< kiwoom::KiwoomClient >::blocking = false
staticconstexpr

false: requests complete through a completion token.

Definition at line 617 of file traits.hpp.

◆ name

std::string_view algotradelib::BrokerTraits< kiwoom::KiwoomClient >::name = kiwoom::Broker::name
staticconstexpr

The broker's name.

Definition at line 614 of file traits.hpp.


The documentation for this struct was generated from the following file: