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

The BlockingSession adapter for kiwoom::KiwoomBlockingClient. More...

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

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

Public Types

using Client = kiwoom::KiwoomBlockingClient
 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.
static Result< QuoteSnapshot > quote (Client &client, InstrumentId instrument)
 Returns a quote.
static Result< PriceLimits > price_limits (Client &client, InstrumentId instrument)
 Returns today's price bounds.
static Result< std::vector< TradePrint > > trades (Client &client, InstrumentId instrument, int count)
 Returns recent executions.
static Result< DepthSnapshot > depth (Client &client, InstrumentId instrument)
 Returns the order book.
static Result< BarSeries > bars (Client &client, BarQuery query)
 Returns bars, paging inside the client.
static Result< Instrument > instrument (Client &client, InstrumentId subject)
 Returns static reference data for one instrument.
static Result< std::vector< AccountListItem > > accounts (Client &client)
 Returns the one account the bound credential drives.
static Result< HoldingsSnapshot > holdings (Client &client, const Account &account)
 Serves the normalized holdings verb once a scope is asserted; see the asynchronous thunk.
static Result< BuyingPower > buying_power (Client &client, const Account &account, Currency currency)
 Returns what the bound account may spend in currency.
static Result< PlaceAck > place_order (Client &client, const Account &account, OrderRequest order)
 Submits an order for the bound account.
static Result< PlaceAck > replace_order (Client &client, const Account &account, Amendment amendment)
 Modifies an order for the bound account.
static Result< PlaceAck > cancel_order (Client &client, const Account &account, Amendment amendment)
 Cancels an order for the bound account.
static Result< WorkingOrdersResult > working_orders (Client &client, const Account &account)
 Returns the amendable orders for the bound account.
static Result< OrderPage > order_history (Client &client, const Account &account, HistoryQuery query)
 Returns order history for the bound account.

Static Public Attributes

static constexpr std::string_view name = kiwoom::Broker::name
 The broker's name.
static constexpr bool blocking = true
 true: requests return their result directly.

Detailed Description

The BlockingSession adapter for kiwoom::KiwoomBlockingClient.

Definition at line 866 of file traits.hpp.

Member Typedef Documentation

◆ Account

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

Definition at line 882 of file traits.hpp.

◆ AccountListItem

Item type of the broker's own account listing.

Definition at line 885 of file traits.hpp.

◆ Amendment

Kiwoom modification and cancellation instruction.

Definition at line 894 of file traits.hpp.

◆ BrokerTag

The broker tag.

Definition at line 888 of file traits.hpp.

◆ Client

The client type.

Definition at line 876 of file traits.hpp.

◆ Config

Kiwoom application credentials and environment selection.

Definition at line 879 of file traits.hpp.

◆ HistoryQuery

Kiwoom order-history selector.

Definition at line 897 of file traits.hpp.

◆ PlaceAck

Acknowledgement Kiwoom returns for an order instruction.

Definition at line 891 of file traits.hpp.

◆ WorkingOrdersResult

Kiwoom amendable-order result.

Definition at line 900 of file traits.hpp.

Member Function Documentation

◆ accounts()

Result< std::vector< AccountListItem > > algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::accounts ( Client & client)
inlinestatic

Returns the one account the bound credential drives.

Parameters
clientThe client.
Returns
The result, or an error.

Definition at line 987 of file traits.hpp.

◆ bars()

Returns bars, paging inside the client.

Parameters
clientThe client.
queryThe query.
Returns
The result, or an error.

Definition at line 968 of file traits.hpp.

◆ buying_power()

Result< BuyingPower > algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::buying_power ( Client & client,
const Account & account,
Currency currency )
inlinestatic

Returns what the bound account may spend in currency.

Parameters
clientThe client.
accountThe bound account.
currencyThe currency (only KRW is answered).
Returns
The result, or an error.

Definition at line 1012 of file traits.hpp.

◆ cancel_order()

Result< PlaceAck > algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::cancel_order ( Client & client,
const Account & account,
Amendment amendment )
inlinestatic

Cancels an order for the bound account.

Parameters
clientThe client.
accountThe bound account.
amendmentThe amendment.
Returns
The result, or an error.

Definition at line 1053 of file traits.hpp.

◆ depth()

Returns the order book.

Parameters
clientThe client.
instrumentThe instrument.
Returns
The result, or an error.

Definition at line 958 of file traits.hpp.

◆ effective_route()

constexpr Venue algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::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 873 of file traits.hpp.

◆ holdings()

Result< HoldingsSnapshot > algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::holdings ( Client & client,
const Account & account )
inlinestatic

Serves the normalized holdings verb once a scope is asserted; see the asynchronous thunk.

Parameters
clientThe client.
accountThe bound account.
Returns
The result, or an error.

Definition at line 997 of file traits.hpp.

◆ instrument()

Result< Instrument > algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::instrument ( Client & client,
InstrumentId subject )
inlinestatic

Returns static reference data for one instrument.

Parameters
clientThe client.
subjectThe instrument.
Returns
The result, or an error.

Definition at line 978 of file traits.hpp.

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

◆ order_history()

Result< OrderPage > algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::order_history ( Client & client,
const Account & account,
HistoryQuery query )
inlinestatic

Returns order history for the bound account.

Parameters
clientThe client.
accountThe bound account.
queryThe query.
Returns
The result, or an error.

Definition at line 1078 of file traits.hpp.

◆ place_order()

Result< PlaceAck > algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::place_order ( Client & client,
const Account & account,
OrderRequest order )
inlinestatic

Submits an order for the bound account.

Parameters
clientThe client.
accountThe bound account.
orderThe order.
Returns
The result, or an error.

Definition at line 1027 of file traits.hpp.

◆ price_limits()

Result< PriceLimits > algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::price_limits ( Client & client,
InstrumentId instrument )
inlinestatic

Returns today's price bounds.

Parameters
clientThe client.
instrumentThe instrument.
Returns
The result, or an error.

Definition at line 933 of file traits.hpp.

◆ quote()

Returns a quote.

Parameters
clientThe client.
instrumentThe instrument.
Returns
The result, or an error.

Definition at line 923 of file traits.hpp.

◆ rate_limit_stats()

const network::RateLimitStats * algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::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 913 of file traits.hpp.

◆ replace_order()

Result< PlaceAck > algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::replace_order ( Client & client,
const Account & account,
Amendment amendment )
inlinestatic

Modifies an order for the bound account.

Parameters
clientThe client.
accountThe bound account.
amendmentThe amendment.
Returns
The result, or an error.

Definition at line 1038 of file traits.hpp.

◆ trades()

Result< std::vector< TradePrint > > algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::trades ( Client & client,
InstrumentId instrument,
int count )
inlinestatic

Returns recent executions.

Parameters
clientThe client.
instrumentThe instrument.
countThe most trades to return.
Returns
The result, or an error.

Definition at line 944 of file traits.hpp.

◆ working_orders()

Result< WorkingOrdersResult > algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::working_orders ( Client & client,
const Account & account )
inlinestatic

Returns the amendable orders for the bound account.

Parameters
clientThe client.
accountThe bound account.
Returns
The result, or an error.

Definition at line 1067 of file traits.hpp.

Member Data Documentation

◆ blocking

bool algotradelib::BrokerTraits< kiwoom::KiwoomBlockingClient >::blocking = true
staticconstexpr

true: requests return their result directly.

Definition at line 906 of file traits.hpp.

◆ name

The broker's name.

Definition at line 903 of file traits.hpp.


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