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

A KIS account: the account number and product code every account request names. More...

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

Public Member Functions

void from_env ()
 Loads the account from the KIS_CANO and (optional, default "01") KIS_ACNT_PRDT_CD environment variables.
void from_json (const std::string &filename)
 Loads the account from a credential file's account_number (eight digits) and account_product_code (two digits, "01" if absent), both strings.

Public Attributes

std::string account_number_
 The eight-digit account number (KIS's CANO).
std::string product_code_
 The two-digit product code (KIS's ACNT_PRDT_CD); "01" for a cash equity account.

Detailed Description

A KIS account: the account number and product code every account request names.

Definition at line 29 of file client.hpp.

Member Function Documentation

◆ from_env()

void algotradelib::kis::KisAccount::from_env ( )
inline

Loads the account from the KIS_CANO and (optional, default "01") KIS_ACNT_PRDT_CD environment variables.

Exceptions
std::runtime_errorif KIS_CANO is not set.

Definition at line 40 of file client.hpp.

Referenced by kis_credentials::load().

◆ from_json()

void algotradelib::kis::KisAccount::from_json ( const std::string & filename)
inline

Loads the account from a credential file's account_number (eight digits) and account_product_code (two digits, "01" if absent), both strings.

The same file KisConfig::from_json reads. Error messages name the file and field, never a value.

Parameters
filenameThe file.
Exceptions
std::runtime_errorif the file cannot be read or parsed, account_number is missing, or a field is not a string of the right number of digits.

Definition at line 61 of file client.hpp.

Referenced by kis_credentials::load().

Member Data Documentation

◆ account_number_

std::string algotradelib::kis::KisAccount::account_number_

The eight-digit account number (KIS's CANO).

Definition at line 31 of file client.hpp.

Referenced by from_env(), and from_json().

◆ product_code_

std::string algotradelib::kis::KisAccount::product_code_

The two-digit product code (KIS's ACNT_PRDT_CD); "01" for a cash equity account.

Definition at line 33 of file client.hpp.

Referenced by from_env(), and from_json().


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