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

The BlockingSession adapter for kis::KisBlockingClient. More...

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

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

Public Types

using Client = kis::KisBlockingClient
 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.
static Result< Instrument > instrument (Client &client, InstrumentId subject)
 Returns static reference data for one instrument.
static Result< TradingCalendar > calendar (Client &client, Country, std::optional< Date > from)
 Returns the calendar, supplying today when no date was given.
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< QuoteSnapshot > quote (Client &client, InstrumentId instrument)
 Returns a quote.
static Result< HoldingsSnapshot > holdings (Client &client, const Account &account)
 Returns holdings for the bound account.
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 = kis::Broker::name
 The broker's name.
static constexpr bool blocking = true
 true: requests return their result directly.

Detailed Description

The BlockingSession adapter for kis::KisBlockingClient.

Definition at line 659 of file traits.hpp.

Member Typedef Documentation

◆ Account

The account type.

Definition at line 677 of file traits.hpp.

◆ Amendment

The amendment type.

Definition at line 686 of file traits.hpp.

◆ BrokerTag

The broker tag.

Definition at line 680 of file traits.hpp.

◆ Client

The client type.

Definition at line 671 of file traits.hpp.

◆ Config

The configuration type.

Definition at line 674 of file traits.hpp.

◆ HistoryQuery

The order-history query type.

Definition at line 689 of file traits.hpp.

◆ PlaceAck

The order acknowledgement type.

Definition at line 683 of file traits.hpp.

◆ WorkingOrdersResult

The working-order result type.

Definition at line 692 of file traits.hpp.

Member Function Documentation

◆ bars()

Result< BarSeries > algotradelib::BrokerTraits< kis::KisBlockingClient >::bars ( Client & client,
BarQuery query )
inlinestatic

Returns bars, paging inside the client.

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

Definition at line 770 of file traits.hpp.

◆ buying_power()

Result< BuyingPower > algotradelib::BrokerTraits< kis::KisBlockingClient >::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.
Returns
The result, or an error.

Definition at line 801 of file traits.hpp.

◆ calendar()

Result< TradingCalendar > algotradelib::BrokerTraits< kis::KisBlockingClient >::calendar ( Client & client,
Country ,
std::optional< Date > from )
inlinestatic

Returns the calendar, supplying today when no date was given.

Parameters
clientThe client.
fromThe first date (today in Korea if empty).
Returns
The result, or an error.

Definition at line 725 of file traits.hpp.

◆ cancel_order()

Result< PlaceAck > algotradelib::BrokerTraits< kis::KisBlockingClient >::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 842 of file traits.hpp.

◆ depth()

Result< DepthSnapshot > algotradelib::BrokerTraits< kis::KisBlockingClient >::depth ( Client & client,
InstrumentId instrument )
inlinestatic

Returns the order book.

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

Definition at line 760 of file traits.hpp.

◆ effective_route()

constexpr Venue algotradelib::BrokerTraits< kis::KisBlockingClient >::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 666 of file traits.hpp.

◆ holdings()

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

Returns holdings for the bound account.

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

Definition at line 790 of file traits.hpp.

◆ instrument()

Result< Instrument > algotradelib::BrokerTraits< kis::KisBlockingClient >::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 715 of file traits.hpp.

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

◆ order_history()

Result< OrderPage > algotradelib::BrokerTraits< kis::KisBlockingClient >::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 867 of file traits.hpp.

◆ place_order()

Result< PlaceAck > algotradelib::BrokerTraits< kis::KisBlockingClient >::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 816 of file traits.hpp.

◆ price_limits()

Result< PriceLimits > algotradelib::BrokerTraits< kis::KisBlockingClient >::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 735 of file traits.hpp.

◆ quote()

Result< QuoteSnapshot > algotradelib::BrokerTraits< kis::KisBlockingClient >::quote ( Client & client,
InstrumentId instrument )
inlinestatic

Returns a quote.

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

Definition at line 780 of file traits.hpp.

◆ rate_limit_stats()

const network::RateLimitStats * algotradelib::BrokerTraits< kis::KisBlockingClient >::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 705 of file traits.hpp.

◆ replace_order()

Result< PlaceAck > algotradelib::BrokerTraits< kis::KisBlockingClient >::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 827 of file traits.hpp.

◆ trades()

Result< std::vector< TradePrint > > algotradelib::BrokerTraits< kis::KisBlockingClient >::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 746 of file traits.hpp.

◆ working_orders()

Result< WorkingOrdersResult > algotradelib::BrokerTraits< kis::KisBlockingClient >::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 856 of file traits.hpp.

Member Data Documentation

◆ blocking

bool algotradelib::BrokerTraits< kis::KisBlockingClient >::blocking = true
staticconstexpr

true: requests return their result directly.

Definition at line 698 of file traits.hpp.

◆ name

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

The broker's name.

Definition at line 695 of file traits.hpp.


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