![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
The error a broker or transport operation returns. More...
#include <algotradelib/src/core/types.hpp>
Public Attributes | |
| ErrorCategory | category_ {ErrorCategory::PROTOCOL} |
| The kind of failure; the field to branch on. | |
| bool | reached_broker_ {true} |
| Whether a request was sent before this error. | |
| int | http_status_ {0} |
| The HTTP status of the reply: set for an HTTP error and for a reply whose body is not a JSON object. 0 if no reply arrived, and on some errors built from a reply that did parse (a declared failure, a missing field) that do not carry it. | |
| std::string | broker_code_ |
| The broker's own error code, verbatim (for example KIS's EGW00201). | |
| std::string | request_id_ |
| The broker's request id for this call, if it gave one. | |
| std::string | message_ |
| A human-readable description, for logs; do not parse it. | |
| std::optional< std::chrono::seconds > | retry_after_ |
| How long the broker asked the caller to wait (Retry-After), for a rate-limit error. | |
| std::optional< int > | rate_limit_ |
| The rate limit the broker says it enforces, in requests per second, for a rate-limit error. | |
The error a broker or transport operation returns.
Branch on category_; the other fields are for diagnosis and logs.
| std::string algotradelib::BrokerError::broker_code_ |
The broker's own error code, verbatim (for example KIS's EGW00201).
Definition at line 761 of file types.hpp.
Referenced by algotradelib::backtest::CommissionPolicy::charge(), algotradelib::network::AsyncHttpClient::close(), algotradelib::backtest::commission_model_from(), algotradelib::backtest::NextBarFillModel::decide(), algotradelib::backtest::Backtester< Strategy, CapsType >::feed(), algotradelib::live::incomplete_history(), algotradelib::kiwoom::invalid_trigger(), algotradelib::kiwoom::kiwoom_declared_error(), algotradelib::kiwoom::kiwoom_recognized_refusal(), algotradelib::kiwoom::order_division(), algotradelib::data_only::refusal(), algotradelib::network::transport_error(), algotradelib::kiwoom::unestablished_holdings_scope(), algotradelib::kis::unsupported_bar_interval(), algotradelib::kiwoom::unsupported_bar_interval(), algotradelib::tossinvest::unsupported_bar_interval(), algotradelib::kis::unsupported_client_order_id(), and algotradelib::kiwoom::unsupported_client_order_id().
| ErrorCategory algotradelib::BrokerError::category_ {ErrorCategory::PROTOCOL} |
The kind of failure; the field to branch on.
Definition at line 744 of file types.hpp.
Referenced by algotradelib::live::SessionExecutor< Session >::cancel(), algotradelib::backtest::CommissionPolicy::charge(), algotradelib::network::AsyncHttpClient::close(), algotradelib::backtest::commission_model_from(), algotradelib::backtest::NextBarFillModel::decide(), algotradelib::backtest::Backtester< Strategy, CapsType >::feed(), algotradelib::live::incomplete_history(), algotradelib::kiwoom::invalid_trigger(), algotradelib::kiwoom::kiwoom_declared_error(), algotradelib::kiwoom::kiwoom_recognized_refusal(), algotradelib::kiwoom::order_division(), algotradelib::runner::outcome_of(), algotradelib::live::SessionExecutor< Session >::place(), algotradelib::data_only::refusal(), algotradelib::network::transport_error(), algotradelib::kiwoom::unestablished_holdings_scope(), algotradelib::kis::unsupported_bar_interval(), algotradelib::kiwoom::unsupported_bar_interval(), algotradelib::tossinvest::unsupported_bar_interval(), algotradelib::kis::unsupported_client_order_id(), and algotradelib::kiwoom::unsupported_client_order_id().
| int algotradelib::BrokerError::http_status_ {0} |
The HTTP status of the reply: set for an HTTP error and for a reply whose body is not a JSON object. 0 if no reply arrived, and on some errors built from a reply that did parse (a declared failure, a missing field) that do not carry it.
Definition at line 759 of file types.hpp.
Referenced by algotradelib::kiwoom::kiwoom_recognized_refusal(), and algotradelib::runner::outcome_of().
| std::string algotradelib::BrokerError::message_ |
A human-readable description, for logs; do not parse it.
For an HTTP error from KIS or Kiwoom it carries the start of the reply's body (at most 512 bytes, then the count of bytes left out); that is an excerpt, not redaction. A broker's declared error carries its own message field. A whole successful reply the adapter cannot read is not copied (a token reply holds the token).
Definition at line 772 of file types.hpp.
Referenced by algotradelib::backtest::CommissionPolicy::charge(), algotradelib::network::AsyncHttpClient::close(), algotradelib::backtest::commission_model_from(), algotradelib::backtest::NextBarFillModel::decide(), algotradelib::backtest::Backtester< Strategy, CapsType >::feed(), algotradelib::live::incomplete_history(), algotradelib::kiwoom::invalid_trigger(), algotradelib::kiwoom::kiwoom_declared_error(), algotradelib::kiwoom::kiwoom_recognized_refusal(), algotradelib::kiwoom::order_division(), algotradelib::data_only::refusal(), algotradelib::network::transport_error(), algotradelib::kiwoom::unestablished_holdings_scope(), algotradelib::kis::unsupported_bar_interval(), algotradelib::kiwoom::unsupported_bar_interval(), algotradelib::tossinvest::unsupported_bar_interval(), algotradelib::kis::unsupported_client_order_id(), and algotradelib::kiwoom::unsupported_client_order_id().
| std::optional<int> algotradelib::BrokerError::rate_limit_ |
| bool algotradelib::BrokerError::reached_broker_ {true} |
Whether a request was sent before this error.
false when nothing was written: the client refused before any I/O (an order id too long, an unsupported time in force), or the transport failed before writing (resolving, connecting, handshaking, a full queue, or a closed client). Such an error is not counted against a rate limit and was not the broker's; a runner may offer the instruction again. Defaults to true.
Definition at line 753 of file types.hpp.
Referenced by algotradelib::backtest::CommissionPolicy::charge(), algotradelib::network::AsyncHttpClient::close(), algotradelib::backtest::commission_model_from(), algotradelib::backtest::NextBarFillModel::decide(), algotradelib::backtest::Backtester< Strategy, CapsType >::feed(), algotradelib::live::incomplete_history(), algotradelib::kiwoom::invalid_trigger(), algotradelib::kiwoom::kiwoom_declared_error(), algotradelib::kiwoom::kiwoom_recognized_refusal(), algotradelib::kiwoom::order_division(), algotradelib::runner::outcome_of(), algotradelib::data_only::refusal(), algotradelib::kiwoom::unestablished_holdings_scope(), algotradelib::kis::unsupported_bar_interval(), algotradelib::kiwoom::unsupported_bar_interval(), algotradelib::tossinvest::unsupported_bar_interval(), algotradelib::kis::unsupported_client_order_id(), and algotradelib::kiwoom::unsupported_client_order_id().
| std::string algotradelib::BrokerError::request_id_ |
| std::optional<std::chrono::seconds> algotradelib::BrokerError::retry_after_ |