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

The BrokerSession adapter for tossinvest::TossClient. More...

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

Inheritance diagram for algotradelib::BrokerTraits< tossinvest::TossClient >:
Collaboration diagram for algotradelib::BrokerTraits< tossinvest::TossClient >:

Public Types

using Client = tossinvest::TossClient
 The client type.
using Config = tossinvest::TossConfig
 The configuration type.
using Account = std::int64_t
 The account type: the account sequence.
using BrokerTag = tossinvest::Broker
 The broker tag.
using PlaceAck = OrderAck
 The order acknowledgement type.
using Amendment = tossinvest::TossAmendment
 The amendment type.
using HistoryQuery = tossinvest::TossOrderQuery
 The order-history query type.
using WorkingOrdersResult = OrderPage
 The working-order result type.
using AccountListItem = tossinvest::TossAccount
 The account-listing item type.

Static Public Member Functions

static constexpr Venue effective_route (Venue) noexcept
 Returns the venue a Toss order reaches: none in particular (Toss does not route by venue, and its listings carry none).
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.
template<typename Token>
static auto calendar (Client &client, Country country, std::optional< Date > from, Token &&token)
 Forwards a calendar 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 prices (Client &client, std::vector< InstrumentId > instruments, Token &&token)
 Forwards a batch quote 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 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 sellable_quantity (Client &client, const Account &account, InstrumentId instrument, Token &&token)
 Forwards a sellable-quantity request for one instrument.
template<typename Token>
static auto commissions (Client &client, const Account &account, Token &&token)
 Forwards a commission-schedule 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, which transmits the identifier only.
template<typename Token>
static auto working_orders (Client &client, const Account &account, Token &&token)
 Forwards an OPEN listing for the bound account.
template<typename Token>
static auto order_history (Client &client, const Account &account, HistoryQuery query, Token &&token)
 Forwards a CLOSED listing for the bound account.
template<typename Token>
static auto order_by_id (Client &client, const Account &account, std::string order_id, Token &&token)
 Forwards a single-order inquiry for the bound account.

Static Public Attributes

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

Detailed Description

The BrokerSession adapter for tossinvest::TossClient.

Definition at line 409 of file traits.hpp.

Member Typedef Documentation

◆ Account

using algotradelib::BrokerTraits< tossinvest::TossClient >::Account = std::int64_t

The account type: the account sequence.

Definition at line 428 of file traits.hpp.

◆ AccountListItem

The account-listing item type.

Definition at line 446 of file traits.hpp.

◆ Amendment

The amendment type.

Definition at line 437 of file traits.hpp.

◆ BrokerTag

The broker tag.

Definition at line 431 of file traits.hpp.

◆ Client

The client type.

Definition at line 422 of file traits.hpp.

◆ Config

The configuration type.

Definition at line 425 of file traits.hpp.

◆ HistoryQuery

The order-history query type.

Definition at line 440 of file traits.hpp.

◆ PlaceAck

The order acknowledgement type.

Definition at line 434 of file traits.hpp.

◆ WorkingOrdersResult

The working-order result type.

Definition at line 443 of file traits.hpp.

Member Function Documentation

◆ accounts()

template<typename Token>
auto algotradelib::BrokerTraits< tossinvest::TossClient >::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 577 of file traits.hpp.

◆ bars()

template<typename Token>
auto algotradelib::BrokerTraits< tossinvest::TossClient >::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 552 of file traits.hpp.

◆ buying_power()

template<typename Token>
auto algotradelib::BrokerTraits< tossinvest::TossClient >::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 591 of file traits.hpp.

◆ calendar()

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

Forwards a calendar request.

Template Parameters
TokenAn Asio completion token.
Parameters
clientThe client.
countryThe market.
fromThe date (empty: the broker's today).
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 486 of file traits.hpp.

◆ cancel_order()

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

Forwards an order cancellation, which transmits the identifier only.

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 683 of file traits.hpp.

◆ commissions()

template<typename Token>
auto algotradelib::BrokerTraits< tossinvest::TossClient >::commissions ( Client & client,
const Account & account,
Token && token )
inlinestatic

Forwards a commission-schedule 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 623 of file traits.hpp.

◆ depth()

template<typename Token>
auto algotradelib::BrokerTraits< tossinvest::TossClient >::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 539 of file traits.hpp.

◆ effective_route()

constexpr Venue algotradelib::BrokerTraits< tossinvest::TossClient >::effective_route ( Venue )
inlinestaticconstexprnoexcept

Returns the venue a Toss order reaches: none in particular (Toss does not route by venue, and its listings carry none).

The venue asked for is ignored.

Returns
Venue::UNSPECIFIED.

Definition at line 419 of file traits.hpp.

◆ holdings()

template<typename Token>
auto algotradelib::BrokerTraits< tossinvest::TossClient >::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 636 of file traits.hpp.

◆ instrument()

template<typename Token>
auto algotradelib::BrokerTraits< tossinvest::TossClient >::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 472 of file traits.hpp.

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

◆ order_by_id()

template<typename Token>
auto algotradelib::BrokerTraits< tossinvest::TossClient >::order_by_id ( Client & client,
const Account & account,
std::string order_id,
Token && token )
inlinestatic

Forwards a single-order inquiry for the bound account.

Template Parameters
TokenAn Asio completion token.
Parameters
clientThe client.
accountThe bound account.
order_idToss's order id.
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 737 of file traits.hpp.

◆ order_history()

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

Forwards a CLOSED listing 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 717 of file traits.hpp.

◆ place_order()

template<typename Token>
auto algotradelib::BrokerTraits< tossinvest::TossClient >::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 650 of file traits.hpp.

◆ price_limits()

template<typename Token>
auto algotradelib::BrokerTraits< tossinvest::TossClient >::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 499 of file traits.hpp.

◆ prices()

template<typename Token>
auto algotradelib::BrokerTraits< tossinvest::TossClient >::prices ( Client & client,
std::vector< InstrumentId > instruments,
Token && token )
inlinestatic

Forwards a batch quote request.

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

Definition at line 526 of file traits.hpp.

◆ quote()

template<typename Token>
auto algotradelib::BrokerTraits< tossinvest::TossClient >::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 565 of file traits.hpp.

◆ rate_limit_stats()

const network::RateLimitStats * algotradelib::BrokerTraits< tossinvest::TossClient >::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 459 of file traits.hpp.

◆ replace_order()

template<typename Token>
auto algotradelib::BrokerTraits< tossinvest::TossClient >::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 664 of file traits.hpp.

◆ sellable_quantity()

template<typename Token>
auto algotradelib::BrokerTraits< tossinvest::TossClient >::sellable_quantity ( Client & client,
const Account & account,
InstrumentId instrument,
Token && token )
inlinestatic

Forwards a sellable-quantity request for one instrument.

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

Definition at line 605 of file traits.hpp.

◆ trades()

template<typename Token>
auto algotradelib::BrokerTraits< tossinvest::TossClient >::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, clamped to 1-50.
tokenThe completion token.
Returns
Whatever the completion token returns.

Definition at line 513 of file traits.hpp.

◆ working_orders()

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

Forwards an OPEN listing 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 703 of file traits.hpp.

Member Data Documentation

◆ blocking

bool algotradelib::BrokerTraits< tossinvest::TossClient >::blocking = false
staticconstexpr

false: requests complete through a completion token.

Definition at line 452 of file traits.hpp.

◆ name

std::string_view algotradelib::BrokerTraits< tossinvest::TossClient >::name = tossinvest::Broker::name
staticconstexpr

The broker's name.

Definition at line 449 of file traits.hpp.


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