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

The BrokerSession adapter for kis::KisClient. More...

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

Inheritance diagram for algotradelib::BrokerTraits< kis::KisClient >:
Collaboration diagram for algotradelib::BrokerTraits< kis::KisClient >:

Public Types

using Client = kis::KisClient
 The client type.
using Config = kis::KisConfig
 The configuration type.
using Account = kis::KisAccount
 The account type.
using BrokerTag = kis::Broker
 The broker tag.
using PlaceAck = kis::KisOrderAck
 The order acknowledgement type.
using Amendment = kis::KisAmendment
 The amendment type.
using HistoryQuery = kis::KisHistoryRange
 The order-history query type.
using WorkingOrdersResult = kis::KisOpenOrderPage
 The working-order result type.

Static Public Member Functions

static constexpr Venue effective_route (Venue asked) noexcept
 Where an order carrying asked actually goes; see kis_effective_route.
static const network::RateLimitStats * rate_limit_stats (const Client &client)
 Returns this client's pacing statistics, or null when it is unpaced.
template<typename Token>
static auto instrument (Client &client, InstrumentId subject, Token &&token)
 Forwards a reference-data request for one instrument.
template<typename Token>
static auto calendar (Client &client, Country, std::optional< Date > from, Token &&token)
 Forwards a calendar request (the market argument is ignored; validate_calendar checks it).
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 quote (Client &client, InstrumentId instrument, Token &&token)
 Forwards a quote 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 for the bound account.
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 = kis::Broker::name
 The broker's name.
static constexpr bool blocking = false
 false: requests complete through a completion token.

Detailed Description

The BrokerSession adapter for kis::KisClient.

Definition at line 400 of file traits.hpp.

Member Typedef Documentation

◆ Account

The account type.

Definition at line 418 of file traits.hpp.

◆ Amendment

The amendment type.

Definition at line 427 of file traits.hpp.

◆ BrokerTag

The broker tag.

Definition at line 421 of file traits.hpp.

◆ Client

The client type.

Definition at line 412 of file traits.hpp.

◆ Config

The configuration type.

Definition at line 415 of file traits.hpp.

◆ HistoryQuery

The order-history query type.

Definition at line 430 of file traits.hpp.

◆ PlaceAck

The order acknowledgement type.

Definition at line 424 of file traits.hpp.

◆ WorkingOrdersResult

The working-order result type.

Definition at line 433 of file traits.hpp.

Member Function Documentation

◆ bars()

template<typename Token>
auto algotradelib::BrokerTraits< kis::KisClient >::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 528 of file traits.hpp.

◆ buying_power()

template<typename Token>
auto algotradelib::BrokerTraits< kis::KisClient >::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.
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 555 of file traits.hpp.

◆ calendar()

template<typename Token>
auto algotradelib::BrokerTraits< kis::KisClient >::calendar ( Client & client,
Country ,
std::optional< Date > from,
Token && token )
inlinestatic

Forwards a calendar request (the market argument is ignored; validate_calendar checks it).

Template Parameters
TokenAn Asio completion token.
Parameters
clientThe client.
fromThe first date (today in Korea if empty).
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 473 of file traits.hpp.

◆ cancel_order()

template<typename Token>
auto algotradelib::BrokerTraits< kis::KisClient >::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 615 of file traits.hpp.

◆ depth()

template<typename Token>
auto algotradelib::BrokerTraits< kis::KisClient >::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 515 of file traits.hpp.

◆ effective_route()

constexpr Venue algotradelib::BrokerTraits< kis::KisClient >::effective_route ( Venue asked)
inlinestaticconstexprnoexcept

Where an order carrying asked actually goes; see kis_effective_route.

Parameters
askedThe order's venue.
Returns
The venue.

Definition at line 407 of file traits.hpp.

◆ holdings()

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

Forwards a holdings request 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 568 of file traits.hpp.

◆ instrument()

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

Forwards a reference-data request for one instrument.

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

Definition at line 459 of file traits.hpp.

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

◆ order_history()

template<typename Token>
auto algotradelib::BrokerTraits< kis::KisClient >::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 647 of file traits.hpp.

◆ place_order()

template<typename Token>
auto algotradelib::BrokerTraits< kis::KisClient >::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 582 of file traits.hpp.

◆ price_limits()

template<typename Token>
auto algotradelib::BrokerTraits< kis::KisClient >::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 488 of file traits.hpp.

◆ quote()

template<typename Token>
auto algotradelib::BrokerTraits< kis::KisClient >::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 541 of file traits.hpp.

◆ rate_limit_stats()

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

Returns this client's pacing statistics, or null when it is unpaced.

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

Definition at line 446 of file traits.hpp.

◆ replace_order()

template<typename Token>
auto algotradelib::BrokerTraits< kis::KisClient >::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 596 of file traits.hpp.

◆ trades()

template<typename Token>
auto algotradelib::BrokerTraits< kis::KisClient >::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 502 of file traits.hpp.

◆ working_orders()

template<typename Token>
auto algotradelib::BrokerTraits< kis::KisClient >::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 633 of file traits.hpp.

Member Data Documentation

◆ blocking

bool algotradelib::BrokerTraits< kis::KisClient >::blocking = false
staticconstexpr

false: requests complete through a completion token.

Definition at line 439 of file traits.hpp.

◆ name

std::string_view algotradelib::BrokerTraits< kis::KisClient >::name = kis::Broker::name
staticconstexpr

The broker's name.

Definition at line 436 of file traits.hpp.


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