algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::BrokerTraits< Client > Struct Template Reference

Describes one broker client to the library: its types, capabilities, call thunks and normalizers. More...

Inheritance diagram for algotradelib::BrokerTraits< Client >:

Detailed Description

template<typename Client>
struct algotradelib::BrokerTraits< Client >

Describes one broker client to the library: its types, capabilities, call thunks and normalizers.

Declared but never defined. To add a broker, specialize it for your client type in your own code; no library file changes. A specialization holds only:

  • associated types and constants: Client, Config, Account, BrokerTag, PlaceAck, Amendment, HistoryQuery, WorkingOrdersResult, name, and the capability constants that BrokerCaps reads;
  • call thunks that forward to the client's own functions, with the broker's own argument types;
  • normalizers and converters, which hold no state and perform no I/O.

A missing member is a compile error where it is first used. Assert ATL_ASSERT_BROKER(Client) (broker_verbs.hpp) in one source file to compile every operation and read every capability at once; it does not call broker_name() or rate_limit_stats().

Member Required
Account, BrokerTag, Config, PlaceAck, Amendment, HistoryQuery, WorkingOrdersResult always
name, blocking, data_only, has_trigger_price, supports_interval(BarInterval) always
every other BrokerCaps constant (true or false), and sellable_source, except the two below always; none has a default
working_orders_state_terminal where has_working_orders
sellable_inquiry_basis where sellable_source is INQUIRY
quote, bars, validate_bars, holdings, validate_place, place_order, replace_order, cancel_order, order_history, normalize_place, to_replacement, to_cancellation, to_history_query, rate_limit_stats always: every session calls them
buying_power, sellable_quantity, commissions, working_orders and normalize_working_orders, instrument, calendar and validate_calendar, price_limits, trades, prices, depth, order_by_id, accounts with selector_of, display_of and type_of where the capability that gates it is claimed

A blocking client (blocking = true) returns each result; an asynchronous one takes a completion handler as its last argument. A market-data vendor can inherit DataOnlyTraits<Tag>, which answers the account side.

Template Parameters
ClientThe broker client type.

Definition at line 41 of file broker_traits.hpp.


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