39 throw std::runtime_error(
"Threshold for tracking best bids " 40 "or offers can't be a negative value. ");
66 , threshold_(other.threshold_)
67 , enabled_(other.enabled_)
83 group_.controlAssignment(
"BBO Threshold Enable", enabled_, value);
100 group_.controlAssignment(
"BBO Threshold", threshold_, value);
116 group_.controlChange(
"BBO Threshold Settings", &BboThreshold::assignNoControl, *
this, other);
142 threshold_ = other.threshold_;
143 enabled_ = other.enabled_;
183 : price_(other.price_)
205 return (price_.enabled());
218 group().controlChange(
"MBO BBO Tracking Settings", &MboBboTracking::assignNoControl, *
this, other);
232 return price_.group();
239 price_.assignNoControl(other.price_);
255 toStr(str, tracking);
279 : price_(other.price_)
280 , quantity_(other.quantity_)
314 return (price_.enabled() || quantity_.enabled());
335 group().controlChange(
"Implied BBO Tracking Settings", &ImpliedBboTracking::assignNoControl, *
this, other);
349 return price_.group();
356 price_.assignNoControl(other.price_);
357 quantity_.assignNoControl(other.quantity_);
374 toStr(str, tracking);
387 , numberOfOrders_(group)
399 , numberOfOrders_(other.numberOfOrders_)
409 return numberOfOrders_;
415 return numberOfOrders_;
421 return (ImpliedBboTracking::enabled() || numberOfOrders_.enabled());
428 ImpliedBboTracking::exceeded(previous, current)
429 || (numberOfOrders_.enabled()
442 group().
controlChange(
"Direct BBO Tracking Settings", &DirectBboTracking::assignNoControl, *
this, other);
459 numberOfOrders_.assignNoControl(other.numberOfOrders_);
475 toStr(str, tracking);
482 template <
class BboTracking>
490 , bboTracking_(group)
501 : maintain_(other.maintain_)
502 , bboTracking_(other.bboTracking_)
525 group().controlAssignment(
"Maintain", maintain_, value);
552 group().controlChange(
"Base Book Management Settings", &BaseBookManagement::assignNoControl, *
this, other);
566 return bboTracking_.group();
573 maintain_ = other.maintain_;
575 bboTracking_.assignNoControl(other.bboTracking_);
583 BboTracking bboTracking_;
588 template <
class BboTracking,
typename Depth>
596 , defaultDepth_(defaultDepth)
607 :
Base(static_cast<const
Base&>(other))
608 , defaultDepth_(other.defaultDepth_)
620 return defaultDepth_;
628 this->group().controlAssignment(
"Default Depth", defaultDepth_, value);
641 this->group().controlChange(
642 "Fixed Depth Book Management Settings", &FixedDepthBookManagement::assignNoControl, *
this, other
663 Base::assignNoControl(other);
665 defaultDepth_ = other.defaultDepth_;
671 template <
class BboTracking,
typename Depth>
689 :
Base(static_cast<const
Base&>(other))
701 this->group().controlChange(
702 "Any Depth Book Management Settings", &AnyDepthBookManagement::assignNoControl, *
this, other
721 Base::assignNoControl(other);
762 toStr(str, strategy);
788 , mboBooks_(&group())
789 , directBooks_(&group(), 10)
790 , impliedBooks_(&group(), 2)
803 , mboBooks_(other.mboBooks_)
804 , directBooks_(other.directBooks_)
805 , impliedBooks_(other.impliedBooks_)
806 , consolidatedBooks_(other.consolidatedBooks_)
807 , updateNotification_(other.updateNotification_)
841 return impliedBooks_;
847 return impliedBooks_;
853 return consolidatedBooks_;
859 return consolidatedBooks_;
867 return updateNotification_;
884 group().
controlChange(
"Book Management Settings", &BookManagement::assignNoControl, *
this, other);
917 mboBooks_.assignNoControl(other.mboBooks_);
919 directBooks_.assignNoControl(other.directBooks_);
921 impliedBooks_.assignNoControl(other.impliedBooks_);
925 updateNotification_ = other.updateNotification_;
938 toStr(str, settings);
BaseBookManagement & maintain(bool value)
Forces Handler to maintain order books.
BookUpdateNotification::Enum updateNotification() const
Defines the way Handler raises onBookUpdated callbacks.
Encapsulates price level concept.
AnyDepthBookManagement(const AnyDepthBookManagement &other)
Initializes the instance as a copy of the other one.
const SettingGroup & group() const
Instance of the group of setting which the given set of settings belongs to.
void assignNoControl(const BboThreshold &other)
Re-initializes the instance as a copy of the other one and bypassing assignment control.
Handler's configuration settings.
Parameters affecting book management machinery for a particular book type (direct, implied, consolidated).
const ImpliedBookManagement & impliedBooks() const
Management and tracking parameters for implied books.
Int32 quantity() const
Quantify for the given price.
Defines tracking for BBO in direct books.
BboThreshold(const BboThreshold &other)
Initializes as a copy of the other one.
FixedDepthBookManagement & defaultDepth(Depth value)
Defines default depth of order book for the security whose definition wasn't received or had no corre...
BboThreshold(const SettingGroup *group=nullptr)
Initializes BBO attribute (price, qty, etc) tracking.
ImpliedBookManagement & impliedBooks()
Management and tracking parameters for implied books.
BookManagement(const BookManagement &other)
Initializes the instance as a copy of the other one.
Parameters affecting book management machinery for a books having variable depth like MBO ones...
FixedDepthBookManagement< DirectBboTracking, MbpBookDepth > DirectBookManagement
Management and tracking parameters for direct books.
const BboTracking & bboTracking() const
Parameters affecting BBO tracking for books which given settings refer to.
~BboThreshold()
Finalizes the group.
DirectBboTracking(const SettingGroup *group=nullptr)
Initializes tracking with the optional grouping services enabled.
BboThreshold & price()
Price tracking attributes.
void assignNoControl(const BaseBookManagement &other)
Re-initializes as a copy of the other instance without involving value assignment control services...
BboThreshold & price()
Price tracking attributes.
BaseBookManagement< ImpliedBboTracking > ConsolidatedBookManagement
Management and tracking parameters for consolidated books.
const DirectBookManagement & directBooks() const
Management and tracking parameters for direct books.
DirectBboTracking & operator=(const DirectBboTracking &other)
Re-initializes instance as a copy of the other one.
#define ONIXS_CMEMDH_NULLPTR
const Decimal & threshold() const
Threshold for the parameter being tracked.
void assignNoControl(const DirectBboTracking &other)
Re-initializes as a copy of the other instance without involving value assignment control services...
const SettingGroup & group() const
Instance of the group of setting which the given set of settings belongs to.
FixedDepthBookManagement< ImpliedBboTracking, MbpBookDepth > ImpliedBookManagement
Management and tracking parameters for implied books.
Defines tracking for BBO in MBO books.
bool enabled() const
Indicates whether tracking enabled at all.
const SettingGroup & group() const
Instance of a group which the given set of settings belongs to.
BaseBookManagement(const BaseBookManagement &other)
Initializes the instance as a copy of the other one.
Book update event is raised once security id is changed in sequence of market data entries being proc...
DirectBookManagement & directBooks()
Management and tracking parameters for direct books.
bool maintain() const
Forces to build order book of a particular kind.
Order as the member of the Market By Order (MBO) book.
const BboThreshold & numberOfOrders() const
Tracking for order quantity.
MboBboTracking(const SettingGroup *group=nullptr)
Initializes tracking settings with optional grouping services.
std::string toStr(const BookManagement &settings)
Serializes book management settings into string.
~FixedDepthBookManagement()
Finalizes the instance.
const BboThreshold & price() const
Price tracking attributes.
BaseBookManagement(const SettingGroup *group=nullptr)
Initializes instance with the default values and setting validation facilities enabled.
Int32 & numberOfOrders()
Updates total number of orders.
void assignNoControl(const MboBboTracking &other)
Re-initializes as a copy of the other instance without involving value assignment control services...
#define ONIXS_CMEMDH_LTWT
const Decimal & price() const
Order price.
MboBboTracking & operator=(const MboBboTracking &other)
Re-initializes the instance as a copy of the other one.
Mantissa mantissa() const
Returns mantissa of given decimal.
ImpliedBboTracking(const SettingGroup *group=nullptr)
Initializes tracking with optional grouping facilities.
void controlAssignment(const Char *description, Assignee &assignee, Value value) const
Guarded assignment of the given value to the given variable.
MboBboTracking(const MboBboTracking &other)
Initializes the instance as a copy of the other one.
bool enabled() const
Indicates whether tracking enabled at all.
bool exceeded(const DirectPriceLevel &previous, const DirectPriceLevel ¤t) const
Checks whether any of thresholds is exceeded.
FixedDepthBookManagement(const SettingGroup *group=nullptr, Depth defaultDepth=0)
Initializes instance with defaults and optional grouping facilities.
bool value(Number &number, const MultiContainer &container, Tag tag)
Finds a tag-value entry in the given collection by the given tag and returns its value component tran...
Defines tracking for BBO in implied books.
AnyDepthBookManagement & operator=(const AnyDepthBookManagement &other)
Re-initializes the instance as a copy of the other one.
const ConsolidatedBookManagement & consolidatedBooks() const
Management and tracking parameters for consolidated books.
Encapsulates price level concept.
DirectBboTracking(const DirectBboTracking &other)
Initializes the instance as a copy of the other one.
Defines tracking attributes for a particular BBO parameter.
bool thresholdExceeded(const Decimal &, const Decimal &, const Decimal &)
Checks whether new value exceeds given threshold in compare to the old value.
bool thresholdExceeded(const Decimal &, Int32, Int32)
Checks whether new value exceeds given threshold in compare to the old value.
FixedDepthBookManagement(const FixedDepthBookManagement &other)
Initializes the instance as a copy of the other one.
Parameters affecting book management machinery for a particular book type (direct, implied, consolidated).
BboThreshold & numberOfOrders()
Tracking for order quantity.
Defines book update notification strategies.
BookManagement & operator=(const BookManagement &other)
Copies settings from the given instance.
BaseBookManagement & operator=(const BaseBookManagement &other)
Re-initializes the instance as a copy of other one.
MboBookManagement & mboBooks()
Management and tracking parameters for direct books.
~DirectBboTracking()
Finalizes the instance.
const Decimal & price() const
Price value.
A real number with floating exponent.
const SettingGroup & group() const
Instance of the group of setting which the given set of settings belongs to.
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
bool exceeded(const ImpliedPriceLevel &previous, const ImpliedPriceLevel ¤t) const
Checks whether any of thresholds is exceeded.
ImpliedBboTracking & operator=(const ImpliedBboTracking &other)
Re-initializes the instance as a copy of the other one.
Base services for settings grouped by a certain criteria.
bool enabled() const
Indicates whether tracking is enabled.
BookManagement(SettingChangeController *controller=nullptr)
Initializes instance with default values.
const BboThreshold & quantity() const
Quantity tracking attributes.
BboThreshold & quantity()
Quantity tracking attributes.
FixedDepthBookManagement & operator=(const FixedDepthBookManagement &other)
Re-initializes the instance as a copy of the other one.
ImpliedBboTracking(const ImpliedBboTracking &other)
Initializes the instance as a copy of the other one.
AnyDepthBookManagement< MboBboTracking, SortedOrders::size_type > MboBookManagement
Management and tracking parameters for MBO books.
#define ONIXS_CMEMDH_EXPORTED
#define ONIXS_CMEMDH_LTWT_CLASS_DECL(name)
BboThreshold & enabled(bool value)
Indicates whether tracking is enabled.
BboThreshold & operator=(const BboThreshold &other)
Re-initializes as a copy of the other one.
BboThreshold & threshold(const Decimal &value)
Updates threshold for the parameter being tracked.
BookManagement & updateNotification(BookUpdateNotification::Enum value)
Defines the way Handler raises order book update event.
bool enabled() const
Indicates whether tracking enabled at all.
const MboBookManagement & mboBooks() const
Management and tracking parameters for direct books.
Represents a service controlling change/update operations for the collections of settings.
void assignNoControl(const ImpliedBboTracking &other)
Re-initializes as a copy of the other instance without involving value assignment control services...
~ImpliedBboTracking()
Finalizes the instance.
const BboThreshold & price() const
Price tracking attributes.
ConsolidatedBookManagement & consolidatedBooks()
Management and tracking parameters for consolidated books.
void throwBadBboThreshold()
Raises exception on invalid best bid/offer threshold value.
bool exceeded(const Order &previous, const Order ¤t) const
Checks whether any of thresholds is exceeded.
BboTracking & bboTracking()
Parameters affecting BBO tracking for books which given settings refer to.
Depth defaultDepth() const
Defines default depth of order book for the security whose definition wasn't received or had no corre...
Parameters affecting book management machinery.
AnyDepthBookManagement(const SettingGroup *group=nullptr)
Initializes the instance with default values.
UInt32 Base
Integral type used as basement for constants.
~BaseBookManagement()
Finalizes the instance.
~MboBboTracking()
Finalizes the instance.
void controlChange(const Char *description, void(Changeable::*change)(), Changeable &changeable) const
Guarded invoke of the given routine which assumes complex change or update for the given object...
void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
#define ONIXS_CMEMDH_NAMESPACE_END