dxFeed Graal CXX API v9.0.0
Loading...
Searching...
No Matches
PriceLevelService Struct Referencefinal

The client of the Order Reconstruction Service (ORCS): the price levels (Order events) and the quotes (Quote events) of a symbol for a period of time. More...

#include <PriceLevelService.hpp>

Inheritance diagram for PriceLevelService:

Public Types

using Ptr = std::shared_ptr<PriceLevelService>
 The alias to a type of shared pointer to the PriceLevelService object.
Public Types inherited from SharedEntity
using Ptr = std::shared_ptr<SharedEntity>
 The alias to a type of shared pointer to the SharedEntity object.

Public Member Functions

 ~PriceLevelService () noexcept override
 Closes the service if it is not closed yet.
std::vector< std::shared_ptr< Order > > getOrders (const CandleSymbol &candleSymbol, const OrderSource &orderSource, std::int64_t from, std::int64_t to, StringParam caller) const
 Returns the price levels of the given CandleSymbol and OrderSource within the given from and to times, sorted by time.
std::vector< std::shared_ptr< Order > > getOrders (const CandleSymbol &candleSymbol, const OrderSource &orderSource, std::int64_t from, std::int64_t to) const
 Returns the price levels of the given CandleSymbol and OrderSource within the given from and to times, sorted by time.
std::vector< std::shared_ptr< Quote > > getQuotes (const CandleSymbol &candleSymbol, std::int64_t from, std::int64_t to, StringParam caller) const
 Returns the quotes of the given CandleSymbol within the given from and to times, sorted by time.
std::vector< std::shared_ptr< Quote > > getQuotes (const CandleSymbol &candleSymbol, std::int64_t from, std::int64_t to) const
 Returns the quotes of the given CandleSymbol within the given from and to times, sorted by time.
std::shared_ptr< AuthOrderSource > getAuthOrderSource () const
 Returns the order sources and the symbols of each order source available to the client, filtered according to the client permissions.
void close ()
 Closes (disconnects) the service.
Public Member Functions inherited from SharedEntity
template<typename T>
bool is () const noexcept
 Checks that the object is of type T: its dynamic type is T or derived from T.
template<typename T>
std::shared_ptr< T > sharedAs () noexcept
 Returns a pointer to the current object wrapped in a smart pointer to type T or std::shared_ptr<T>{nullptr} if the object is not managed by std::shared_ptr.
template<typename T>
std::shared_ptr< T > sharedAs () const noexcept
 Returns a pointer to the current object wrapped in a smart pointer to type T or std::shared_ptr<T>{nullptr} if the object is not managed by std::shared_ptr.
virtual std::string toString () const
 Returns a string representation of the current object.
Public Member Functions inherited from Entity
virtual ~Entity () noexcept
 The default virtual d-tor.

Static Public Member Functions

static std::shared_ptr< PriceLevelService > create (StringParam address)
 Creates a new service and connects it to the RMI endpoint at the given address.
Static Public Member Functions inherited from RequireMakeShared< PriceLevelService >
static auto createShared (Args &&...args)
 Creates a smart pointer to an object.

Static Public Attributes

static constexpr std::string_view GRANULARITY_ATTRIBUTE_KEY = "gr"
 The key of the custom CandleSymbol attribute that specifies the granularity of the price level updates in the response, in seconds (AAPL{=d,gr=s} or AAPL{=d,gr=10}).

Detailed Description

The client of the Order Reconstruction Service (ORCS): the price levels (Order events) and the quotes (Quote events) of a symbol for a period of time.

auto service = PriceLevelService::create("orcs.example.com:7777[login=entitle:<token>]");
auto orders = service->getOrders(CandleSymbol::valueOf("AAPL{=d,gr=s}"), OrderSource::NTV,
TimeFormat::DEFAULT.parse("20260110-100000"),
TimeFormat::DEFAULT.parse("20260110-230000"), "sample");
service->close();
static const OrderSource NTV
NASDAQ Total View.
Definition OrderSource.hpp:235
static CandleSymbol valueOf(StringParam symbol)
Converts the given string symbol into the candle symbol object.
Definition CandleSymbol.cpp:513
static std::shared_ptr< PriceLevelService > create(StringParam address)
Creates a new service and connects it to the RMI endpoint at the given address.
Definition PriceLevelService.cpp:24
static const TimeFormat DEFAULT
An instance of TimeFormat that corresponds to default timezone as returned by TimeZone::getDefault() ...
Definition TimeFormat.hpp:36

Member Function Documentation

◆ close()

void PriceLevelService::close ( )

Closes (disconnects) the service.

The next calls of close() do nothing.

Referenced by ~PriceLevelService().

◆ create()

std::shared_ptr< PriceLevelService > PriceLevelService::create ( StringParam address)
static

Creates a new service and connects it to the RMI endpoint at the given address.

Parameters
addressThe address of the RMI endpoint of the service. To pass an authorization token, add [login=entitle:<token>] to the address.
Returns
a new service.

◆ getAuthOrderSource()

std::shared_ptr< AuthOrderSource > PriceLevelService::getAuthOrderSource ( ) const

Returns the order sources and the symbols of each order source available to the client, filtered according to the client permissions.

It contains only the existing data as of now (no delisted symbols, for example).

Returns
the available order sources and symbols.

◆ getOrders() [1/2]

std::vector< std::shared_ptr< Order > > PriceLevelService::getOrders ( const CandleSymbol & candleSymbol,
const OrderSource & orderSource,
std::int64_t from,
std::int64_t to ) const

Returns the price levels of the given CandleSymbol and OrderSource within the given from and to times, sorted by time.

The caller identifier is the default one of the Graal SDK ("dxfg").

Parameters
candleSymbolThe candle symbol to request.
orderSourceThe order source to request.
fromThe time in UTC (milliseconds since the Unix epoch) to request from.
toThe time in UTC (milliseconds since the Unix epoch) to request to.
Returns
the Order events sorted by time.
See also
getOrders(const CandleSymbol &, const OrderSource &, std::int64_t, std::int64_t, StringParam) const

◆ getOrders() [2/2]

std::vector< std::shared_ptr< Order > > PriceLevelService::getOrders ( const CandleSymbol & candleSymbol,
const OrderSource & orderSource,
std::int64_t from,
std::int64_t to,
StringParam caller ) const

Returns the price levels of the given CandleSymbol and OrderSource within the given from and to times, sorted by time.

The candle symbol shall contain a supported CandlePeriod and the custom attribute PriceLevelService::GRANULARITY_ATTRIBUTE_KEY ("gr") with the granularity in seconds (the minimal value is 1 second). If the period or the granularity is not supported by the service, the list is empty.

Parameters
candleSymbolThe candle symbol to request.
orderSourceThe order source to request.
fromThe time in UTC (milliseconds since the Unix epoch) to request from.
toThe time in UTC (milliseconds since the Unix epoch) to request to.
callerThe caller identifier.
Returns
the Order events sorted by time.

◆ getQuotes() [1/2]

std::vector< std::shared_ptr< Quote > > PriceLevelService::getQuotes ( const CandleSymbol & candleSymbol,
std::int64_t from,
std::int64_t to ) const

Returns the quotes of the given CandleSymbol within the given from and to times, sorted by time.

The caller identifier is the default one of the Graal SDK ("dxfg").

Parameters
candleSymbolThe candle symbol to request.
fromThe time in UTC (milliseconds since the Unix epoch) to request from.
toThe time in UTC (milliseconds since the Unix epoch) to request to.
Returns
the Quote events sorted by time.

◆ getQuotes() [2/2]

std::vector< std::shared_ptr< Quote > > PriceLevelService::getQuotes ( const CandleSymbol & candleSymbol,
std::int64_t from,
std::int64_t to,
StringParam caller ) const

Returns the quotes of the given CandleSymbol within the given from and to times, sorted by time.

Parameters
candleSymbolThe candle symbol to request.
fromThe time in UTC (milliseconds since the Unix epoch) to request from.
toThe time in UTC (milliseconds since the Unix epoch) to request to.
callerThe caller identifier.
Returns
the Quote events sorted by time.