algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::tossinvest Namespace Reference

The Toss Securities Open API client. More...

Classes

struct  Broker
 The Toss Securities broker tag: order references are typed by it, so a Toss reference works with both Toss clients and with no other broker. More...
struct  TossAccount
 A Toss account, as account discovery (async_accounts) returns it. More...
struct  TossAmendment
 An amendment of a Toss order: a new price, and for a Korean order a new quantity. More...
class  TossAuth
 Obtains and caches a Toss access token with blocking requests; thread-safe. More...
class  TossBlockingClient
 Blocking facade that drives TossClient on a private event loop. More...
class  TossClient
 The asynchronous Toss Securities REST client: market data, accounts and orders. More...
struct  TossConfig
 Toss Securities credentials (client id and secret). Toss has no demo environment. More...
struct  TossOrderQuery
 A Toss order-listing query. More...
struct  TossRest
 A Toss REST access token and its expiry. More...

Typedefs

using TossHttpClient = network::HttpClient
 The blocking HTTP client TossAuth uses.

Enumerations

enum class  TossOrderScope { OPEN , CLOSED }
 Which orders a Toss order listing returns. More...

Functions

std::optional< std::chrono::seconds > retry_after (const network::HttpResponse &response)
 Reads the Retry-After header of a Toss rate-limit refusal.
std::optional< int > reported_rate_limit (const network::HttpResponse &response)
 Reads the X-RateLimit-Limit header of a Toss rate-limit refusal (requests per second).
std::optional< BrokerError > unsupported_bar_interval (BarInterval interval)
 Refuses a bar interval Toss does not publish (it publishes one-minute and one-day bars only; nothing is aggregated).

Detailed Description

The Toss Securities Open API client.

Typedef Documentation

◆ TossHttpClient

The blocking HTTP client TossAuth uses.

Definition at line 9 of file network.hpp.

Enumeration Type Documentation

◆ TossOrderScope

Which orders a Toss order listing returns.

Enumerator
OPEN 

Open orders: pending, partly filled, or with an amendment or cancellation pending.

CLOSED 

Ended orders (including a partly filled order that ended).

Definition at line 41 of file client.hpp.

Function Documentation

◆ reported_rate_limit()

std::optional< int > algotradelib::tossinvest::reported_rate_limit ( const network::HttpResponse & response)
inline

Reads the X-RateLimit-Limit header of a Toss rate-limit refusal (requests per second).

Parameters
responseThe response.
Returns
The limit, or std::nullopt if absent or not a positive whole number.

Definition at line 109 of file client.hpp.

Referenced by reported_rate_limit().

◆ retry_after()

std::optional< std::chrono::seconds > algotradelib::tossinvest::retry_after ( const network::HttpResponse & response)
inline

Reads the Retry-After header of a Toss rate-limit refusal.

Parameters
responseThe response.
Returns
The delay, or std::nullopt if absent or not a whole number.

Definition at line 96 of file client.hpp.

Referenced by retry_after().

◆ unsupported_bar_interval()

std::optional< BrokerError > algotradelib::tossinvest::unsupported_bar_interval ( BarInterval interval)
inline

Refuses a bar interval Toss does not publish (it publishes one-minute and one-day bars only; nothing is aggregated).

Parameters
intervalThe interval.
Returns
An INVALID_ARGUMENT error (unsupported_interval, not sent), or std::nullopt.

Definition at line 123 of file client.hpp.

Referenced by unsupported_bar_interval().