|
| template<typename Client> |
| static const network::RateLimitStats * | rate_limit_stats (const Client &) |
| | Reports that the client runs no rate limiter; declare your own if it does.
|
| static std::optional< BrokerError > | validate_place (const OrderRequest &) |
| | Refuses every order before it is built.
|
| static Result< PlacedOrder< Tag > > | normalize_place (Result< PlaceAck > raw) |
| | Passes the refusal through (an acknowledgement is refused too).
|
| static Result< Amendment > | to_replacement (const OrderRef< Tag > &, const AmendInstruction &) |
| | Refuses an amendment.
|
| static Result< Amendment > | to_cancellation (const OrderRef< Tag > &, const AmendInstruction &) |
| | Refuses a cancellation.
|
| static Result< HistoryQuery > | to_history_query (const Account &, const OrderHistoryQuery &) |
| | Refuses a history query.
|
| template<typename Client> |
| static Result< HoldingsSnapshot > | holdings (Client &, Account &) |
| | Refuses holdings.
|
| template<typename Client, typename Handler> |
| static void | holdings (Client &, Account &, Handler &&handler) |
| | Refuses holdings, asynchronously.
|
| template<typename Client> |
| static Result< PlaceAck > | place_order (Client &, Account &, OrderRequest) |
| | Refuses a placement.
|
| template<typename Client, typename Handler> |
| static void | place_order (Client &, Account &, OrderRequest, Handler &&handler) |
| | Refuses a placement, asynchronously.
|
| template<typename Client> |
| static Result< PlaceAck > | replace_order (Client &, Account &, Amendment) |
| | Refuses a replacement.
|
| template<typename Client, typename Handler> |
| static void | replace_order (Client &, Account &, Amendment, Handler &&handler) |
| | Refuses a replacement, asynchronously.
|
| template<typename Client> |
| static Result< PlaceAck > | cancel_order (Client &, Account &, Amendment) |
| | Refuses a cancellation.
|
| template<typename Client, typename Handler> |
| static void | cancel_order (Client &, Account &, Amendment, Handler &&handler) |
| | Refuses a cancellation, asynchronously.
|
| template<typename Client> |
| static Result< OrderPage > | order_history (Client &, Account &, HistoryQuery) |
| | Refuses order history.
|
| template<typename Client, typename Handler> |
| static void | order_history (Client &, Account &, HistoryQuery, Handler &&handler) |
| | Refuses order history, asynchronously.
|
template<typename Tag>
struct algotradelib::DataOnlyTraits< Tag >
A base for the BrokerTraits of a market-data client that cannot trade.
Inherit it and declare only what the vendor serves:
template <>
using Client = my::Client;
using Config = my::Config;
static constexpr std::string_view name = my::Tag::name;
static constexpr bool blocking = true;
static constexpr bool supports_interval(
BarInterval interval);
static std::optional<BrokerError> validate_bars(
const BarQuery& query);
};
ATL_ASSERT_BROKER(my::Client);
Either a value or a BrokerError.
BarInterval
The period one bar covers.
Describes one broker client to the library: its types, capabilities, call thunks and normalizers.
A base for the BrokerTraits of a market-data client that cannot trade.
Identifies an instrument: its country, venue and symbol.
An asynchronous client takes the completion token as the last argument. To serve more (a calendar, reference data, price limits), declare that capability true and add its thunk.
Every account-side member (holdings, place, replace, cancel, history) refuses before any I/O with data_only::refusal(); none returns success, since an empty holdings or history would be read as facts about an account. So:
The account-side members ignore their client, account, request, reference and instruction arguments, which are unnamed.
- Note
- A member you declare hides every inherited member of that name, overloads included (declaring a blocking holdings hides the asynchronous one); re-expose with using DataOnlyTraits<Tag>::holdings;.
- Warning
- Not a base for a trading adapter that is still incomplete.
- Template Parameters
-
| Tag | The vendor's tag type. |
Definition at line 148 of file data_only_traits.hpp.