3#include "./broker_traits.hpp"
4#include "./market_data.hpp"
17constexpr bool terminal_working_state() {
18 if constexpr (T::has_working_orders) {
19 return T::working_orders_state_terminal;
31constexpr SellableBasis inquiry_basis() {
33 return T::sellable_inquiry_basis;
35 return SellableBasis{};
55template <
typename Client>
205 return Traits::supports_interval(interval);
216template <
typename Caps>
218 constexpr bool read[] = {
219 Caps::has_account_discovery,
220 Caps::has_client_order_id,
221 Caps::has_working_orders,
222 Caps::has_amendable_quantity,
223 Caps::working_orders_state_terminal,
224 Caps::has_trigger_price,
226 Caps::has_order_by_id,
227 Caps::has_partial_cancel,
228 Caps::history_requires_range,
229 Caps::has_history_cursor,
230 Caps::has_history_limit,
231 Caps::has_history_symbol_filter,
233 Caps::has_price_limits,
234 Caps::has_trade_prints,
235 Caps::has_batch_prices,
236 Caps::has_buying_power,
237 Caps::has_buying_power_quantity,
240 Caps::has_commission_schedule,
241 Caps::has_reference_data,
242 Caps::has_batch_reference_data,
244 Caps::has_calendar_range,
245 Caps::has_calendar_sessions,
247 static_cast<void>(read);
249 static_cast<void>(&Caps::supports_interval);
258template <
typename Client>
The library: broker-neutral types (core), and the modules below.
constexpr bool reads_every_capability()
Reads every capability constant of a capability set, so a missing one fails to compile here.
SellableSource
Where the library gets a broker's sellable quantity.
@ INQUIRY
From a per-instrument inquiry, made only where the snapshot has no figure.
constexpr bool answers_every_capability()
Reads every capability of a client's traits (see reads_every_capability).
BarInterval
The period one bar covers.
What one broker client implements, as compile-time constants.
static constexpr bool has_history_limit
Whether an order-history inquiry accepts a row limit (OrderHistoryQuery::limit_).
static constexpr bool has_commission_schedule
Whether the broker publishes the account's commission rates.
static constexpr SellableBasis sellable_inquiry_basis
What a sellable figure from the per-instrument inquiry covers.
static constexpr bool has_batch_prices
Whether the broker quotes several instruments in one request.
static constexpr bool has_amendable_quantity
Whether the broker reports the quantity still amendable on an open order.
static constexpr bool has_history_cursor
Whether an order-history answer can carry a cursor to the next page.
static constexpr bool history_requires_range
Whether an order-history inquiry needs a date range (OrderHistoryQuery::from_).
static constexpr bool has_client_order_id
Whether the broker accepts an idempotency key (OrderRequest::client_order_id_).
static constexpr bool has_price_limits
Whether the broker publishes the day's price limits.
static constexpr bool has_history_symbol_filter
Whether an order-history inquiry can filter by symbol.
static constexpr bool has_account_discovery
Whether the broker lists the selectable accounts.
static constexpr SellableSource sellable_source
Where the library gets the sellable quantity: HOLDINGS costs nothing, INQUIRY one request per instrum...
static constexpr bool has_reference_data
Whether the broker publishes instrument reference data.
static constexpr bool has_calendar
Whether the broker publishes the trading calendar.
static constexpr bool has_trade_prints
Whether the broker publishes recent trades.
static constexpr bool has_partial_cancel
Whether the broker can cancel part of an order.
static constexpr bool has_buying_power
Whether the broker reports buying power.
static constexpr bool has_calendar_range
Whether one calendar request covers a span of dates.
static constexpr bool has_order_by_id
Whether the broker can look up one order by its id.
static constexpr bool supports_interval(BarInterval interval)
Tests whether the broker publishes bars of an interval.
static constexpr bool data_only
Whether the client is a market-data source that takes no orders (built on DataOnlyTraits).
static constexpr bool has_buying_power_quantity
Whether the broker can also say how many shares are affordable.
static constexpr bool has_trigger_price
Whether the adapter sends trigger prices (stop-limit orders).
static constexpr bool working_orders_state_terminal
Whether the working-order listing can show a terminal status (filled, cancelled, ....
static constexpr bool has_batch_reference_data
Whether one reference-data request can cover several instruments.
static constexpr bool has_calendar_sessions
Whether the broker publishes intraday session hours (only Toss); the library does not expose them yet...
static constexpr bool has_depth
Whether the broker publishes the order book (depth).
BrokerTraits< Client > Traits
The traits specialization the constants are read from.
static constexpr bool has_working_orders
Whether the broker lists the orders still open to amendment. A listing shows only what the broker's A...
Describes one broker client to the library: its types, capabilities, call thunks and normalizers.
What a sellable quantity covers, and how RiskGuard must treat resting sells against it.
@ UNESTABLISHED
Not established; RiskGuard refuses.