OnixS C++ CME MDP Premium Market Data Handler  5.8.3
API Documentation
BookManagement.h
Go to the documentation of this file.
1 // Copyright Onix Solutions Limited [OnixS]. All rights reserved.
2 //
3 // This software owned by Onix Solutions Limited [OnixS] and is
4 // protected by copyright law and international copyright treaties.
5 //
6 // Access to and use of the software is governed by the terms of the applicable
7 // OnixS Software Services Agreement (the Agreement) and Customer end user license
8 // agreements granting a non-assignable, non-transferable and non-exclusive license
9 // to use the software for it's own data processing purposes under the terms defined
10 // in the Agreement.
11 //
12 // Except as otherwise granted within the terms of the Agreement, copying or
13 // reproduction of any part of this source code or associated reference material
14 // to any other location for further reproduction or redistribution, and any
15 // amendments to this copyright notice, are expressly prohibited.
16 //
17 // Any reproduction or redistribution for sale or hiring of the Software not in
18 // accordance with the terms of the Agreement is a violation of copyright law.
19 //
20 
21 #pragma once
22 
23 #include <string>
24 
25 #include <OnixS/CME/MDH/Decimal.h>
26 
28 
31 
33 
35 
36 /// Raises exception on invalid best bid/offer threshold value.
37 inline void throwBadBboThreshold()
38 {
39  throw std::runtime_error("Threshold for tracking best bids "
40  "or offers can't be a negative value. ");
41 }
42 
43 /// Defines tracking attributes for a particular BBO parameter.
45 {
46 public:
47  /// Initializes BBO attribute (price, qty, etc) tracking.
48  ///
49  /// Optional setting group instance allows binding the given
50  /// set of settings to a particular group of settings.
52  : group_(group ? *group : SettingGroup::null())
53  , threshold_()
54  , enabled_(false)
55  {
56  }
57 
58  /// Initializes as a copy of the
59  /// other one.
60  ///
61  /// Attributes controlling value
62  /// assignment aren't cloned and
63  /// thus only settings are copied.
64  BboThreshold(const BboThreshold& other)
65  : group_(SettingGroup::null())
66  , threshold_(other.threshold_)
67  , enabled_(other.enabled_)
68  {
69  }
70 
71  /// Finalizes the group.
73 
74  /// Indicates whether tracking is enabled.
75  bool enabled() const
76  {
77  return enabled_;
78  }
79 
80  /// Indicates whether tracking is enabled.
82  {
83  group_.controlAssignment("BBO Threshold Enable", enabled_, value);
84 
85  return *this;
86  }
87 
88  /// Threshold for the parameter being tracked.
89  const Decimal& threshold() const
90  {
91  return threshold_;
92  }
93 
94  /// Updates threshold for the
95  /// parameter being tracked.
97  {
98  if (0 <= value.mantissa())
99  {
100  group_.controlAssignment("BBO Threshold", threshold_, value);
101  }
102  else
103  {
105  }
106 
107  return *this;
108  }
109 
110  /// Re-initializes as a copy of the other one.
111  ///
112  /// Attributes controlling value assignment aren't
113  /// cloned and thus only settings are copied.
115  {
116  group_.controlChange("BBO Threshold Settings", &BboThreshold::assignNoControl, *this, other);
117 
118  return *this;
119  }
120 
121 protected:
122  /// Lets grouping and value assignment control functioning.
124 
125  /// Lets grouping and value assignment control functioning.
127 
128  /// Lets grouping and value assignment control functioning.
130 
131  /// Instance of a group which the
132  /// given set of settings belongs to.
133  const SettingGroup& group() const
134  {
135  return group_;
136  }
137 
138  /// Re-initializes the instance as a copy of the
139  /// other one and bypassing assignment control.
140  void assignNoControl(const BboThreshold& other)
141  {
142  threshold_ = other.threshold_;
143  enabled_ = other.enabled_;
144  }
145 
146 private:
147  // Group which the given set of settings belongs to.
148  const SettingGroup& group_;
149 
150  // Actual threshold value.
151  Decimal threshold_;
152 
153  // Indicates whether threshold must be used.
154  bool enabled_;
155 };
156 
157 /// Checks whether new value exceeds given
158 /// threshold in compare to the old value.
160 bool thresholdExceeded(const Decimal&, const Decimal&, const Decimal&);
161 
162 /// Checks whether new value exceeds given
163 /// threshold in compare to the old value.
165 bool thresholdExceeded(const Decimal&, Int32, Int32);
166 
167 /// Defines tracking for BBO in MBO books.
169 {
170 public:
171  /// Initializes tracking settings
172  /// with optional grouping services.
174  : price_(group)
175  {
176  }
177 
178  /// Initializes the instance as a copy of the other one.
179  ///
180  /// Attributes controlling value assignment aren't
181  /// cloned and thus only settings' values are copied.
183  : price_(other.price_)
184  {
185  }
186 
187  /// Finalizes the instance.
189 
190  /// Price tracking attributes.
191  const BboThreshold& price() const
192  {
193  return price_;
194  }
195 
196  /// Price tracking attributes.
198  {
199  return price_;
200  }
201 
202  /// Indicates whether tracking enabled at all.
203  bool enabled() const
204  {
205  return (price_.enabled());
206  }
207 
208  /// Checks whether any of thresholds is exceeded.
209  bool exceeded(const Order& previous, const Order& current) const
210  {
211  return (price_.enabled() && thresholdExceeded(price_.threshold(), previous.price(), current.price()));
212  }
213 
214  /// Re-initializes the instance
215  /// as a copy of the other one.
217  {
218  group().controlChange("MBO BBO Tracking Settings", &MboBboTracking::assignNoControl, *this, other);
219 
220  return *this;
221  }
222 
223 protected:
224  /// Lets grouping and value assignment control functioning.
225  template <class>
226  friend class BaseBookManagement;
227 
228  /// Instance of the group of setting which
229  /// the given set of settings belongs to.
230  const SettingGroup& group() const
231  {
232  return price_.group();
233  }
234 
235  /// Re-initializes as a copy of the other instance
236  /// without involving value assignment control services.
237  void assignNoControl(const MboBboTracking& other)
238  {
239  price_.assignNoControl(other.price_);
240  }
241 
242 private:
243  BboThreshold price_;
244 };
245 
246 /// Serializes BBO tracking parameters into string.
248 void toStr(std::string&, const MboBboTracking&);
249 
250 /// Serializes BBO tracking parameters into string.
251 inline std::string toStr(const MboBboTracking& tracking)
252 {
253  std::string str;
254 
255  toStr(str, tracking);
256 
257  return str;
258 }
259 
260 /// Defines tracking for BBO in implied books.
262 {
263 public:
264  /// Initializes tracking with
265  /// optional grouping facilities.
267  : price_(group)
268  , quantity_(group)
269  {
270  }
271 
272  /// Initializes the instance
273  /// as a copy of the other one.
274  ///
275  /// Attributes controlling value
276  /// assignment aren't cloned and
277  /// thus only settings are copied.
279  : price_(other.price_)
280  , quantity_(other.quantity_)
281  {
282  }
283 
284  /// Finalizes the instance.
286 
287  /// Price tracking attributes.
288  const BboThreshold& price() const
289  {
290  return price_;
291  }
292 
293  /// Price tracking attributes.
295  {
296  return price_;
297  }
298 
299  /// Quantity tracking attributes.
300  const BboThreshold& quantity() const
301  {
302  return quantity_;
303  }
304 
305  /// Quantity tracking attributes.
307  {
308  return quantity_;
309  }
310 
311  /// Indicates whether tracking enabled at all.
312  bool enabled() const
313  {
314  return (price_.enabled() || quantity_.enabled());
315  }
316 
317  /// Checks whether any of thresholds is exceeded.
318  bool exceeded(const ImpliedPriceLevel& previous, const ImpliedPriceLevel& current) const
319  {
320  return (
321  (price_.enabled() && thresholdExceeded(price_.threshold(), previous.price(), current.price()))
322  || (quantity_.enabled() && thresholdExceeded(quantity_.threshold(), previous.quantity(), current.quantity())
323  )
324  );
325  }
326 
327  /// Re-initializes the instance
328  /// as a copy of the other one.
329  ///
330  /// Attributes controlling value
331  /// assignment aren't cloned and
332  /// thus only settings are copied.
334  {
335  group().controlChange("Implied BBO Tracking Settings", &ImpliedBboTracking::assignNoControl, *this, other);
336 
337  return *this;
338  }
339 
340 protected:
341  /// Lets grouping and value assignment control functioning.
342  template <class>
343  friend class BaseBookManagement;
344 
345  /// Instance of the group of setting which
346  /// the given set of settings belongs to.
347  const SettingGroup& group() const
348  {
349  return price_.group();
350  }
351 
352  /// Re-initializes as a copy of the other instance
353  /// without involving value assignment control services.
355  {
356  price_.assignNoControl(other.price_);
357  quantity_.assignNoControl(other.quantity_);
358  }
359 
360 private:
361  BboThreshold price_;
362  BboThreshold quantity_;
363 };
364 
365 /// Serializes BBO tracking parameters into string.
367 void toStr(std::string&, const ImpliedBboTracking&);
368 
369 /// Serializes BBO tracking parameters into string.
370 inline std::string toStr(const ImpliedBboTracking& tracking)
371 {
372  std::string str;
373 
374  toStr(str, tracking);
375 
376  return str;
377 }
378 
379 /// Defines tracking for BBO in direct books.
381 {
382 public:
383  /// Initializes tracking with the
384  /// optional grouping services enabled.
386  : ImpliedBboTracking(group)
387  , numberOfOrders_(group)
388  {
389  }
390 
391  /// Initializes the instance
392  /// as a copy of the other one.
393  ///
394  /// Attributes controlling value
395  /// assignment aren't cloned and
396  /// thus only settings are copied.
398  : ImpliedBboTracking(static_cast<const ImpliedBboTracking&>(other))
399  , numberOfOrders_(other.numberOfOrders_)
400  {
401  }
402 
403  /// Finalizes the instance.
405 
406  /// Tracking for order quantity.
408  {
409  return numberOfOrders_;
410  }
411 
412  /// Tracking for order quantity.
414  {
415  return numberOfOrders_;
416  }
417 
418  /// Indicates whether tracking enabled at all.
419  bool enabled() const
420  {
421  return (ImpliedBboTracking::enabled() || numberOfOrders_.enabled());
422  }
423 
424  /// Checks whether any of thresholds is exceeded.
425  bool exceeded(const DirectPriceLevel& previous, const DirectPriceLevel& current) const
426  {
427  return (
428  ImpliedBboTracking::exceeded(previous, current)
429  || (numberOfOrders_.enabled()
430  && thresholdExceeded(numberOfOrders_.threshold(), previous.numberOfOrders(), current.numberOfOrders()))
431  );
432  }
433 
434  /// Re-initializes instance as
435  /// a copy of the other one.
436  ///
437  /// Attributes controlling value
438  /// assignment aren't cloned and
439  /// thus only settings are copied.
441  {
442  group().controlChange("Direct BBO Tracking Settings", &DirectBboTracking::assignNoControl, *this, other);
443 
444  return *this;
445  }
446 
447 protected:
448  /// Lets grouping and value
449  /// assignment control functioning.
450  template <class>
451  friend class BaseBookManagement;
452 
453  /// Re-initializes as a copy of the other instance
454  /// without involving value assignment control services.
456  {
458 
459  numberOfOrders_.assignNoControl(other.numberOfOrders_);
460  }
461 
462 private:
463  BboThreshold numberOfOrders_;
464 };
465 
466 /// Serializes BBO tracking parameters into string.
468 void toStr(std::string&, const DirectBboTracking&);
469 
470 /// Serializes BBO tracking parameters into string.
471 inline std::string toStr(const DirectBboTracking& tracking)
472 {
473  std::string str;
474 
475  toStr(str, tracking);
476 
477  return str;
478 }
479 
480 /// Parameters affecting book management machinery for
481 /// a particular book type (direct, implied, consolidated).
482 template <class BboTracking>
484 {
485 public:
486  /// Initializes instance with the default values
487  /// and setting validation facilities enabled.
489  : maintain_(false)
490  , bboTracking_(group)
491  {
492  }
493 
494  /// Initializes the instance
495  /// as a copy of the other one.
496  ///
497  /// Attributes controlling value
498  /// assignment aren't cloned and
499  /// thus only settings are copied.
501  : maintain_(other.maintain_)
502  , bboTracking_(other.bboTracking_)
503  {
504  }
505 
506  /// Finalizes the instance.
508 
509  /// Forces to build order book of a particular kind.
510  ///
511  /// Unless parameter is set to 'true', Handler doesn't
512  /// construct and doesn't process data blocks for the
513  /// books of given kind. If book isn't built, book snapshot
514  /// retrieval is not possible.
515  ///
516  /// @note Default value is 'false'.
517  bool maintain() const
518  {
519  return maintain_;
520  }
521 
522  /// Forces Handler to maintain order books.
524  {
525  group().controlAssignment("Maintain", maintain_, value);
526 
527  return *this;
528  }
529 
530  /// Parameters affecting BBO tracking for
531  /// books which given settings refer to.
532  const BboTracking& bboTracking() const
533  {
534  return bboTracking_;
535  }
536 
537  /// Parameters affecting BBO tracking for
538  /// books which given settings refer to.
539  BboTracking& bboTracking()
540  {
541  return bboTracking_;
542  }
543 
544  /// Re-initializes the instance
545  /// as a copy of other one.
546  ///
547  /// Attributes controlling value
548  /// assignment aren't cloned and
549  /// thus only settings are copied.
551  {
552  group().controlChange("Base Book Management Settings", &BaseBookManagement::assignNoControl, *this, other);
553 
554  return *this;
555  }
556 
557 protected:
558  /// Lets grouping and value
559  /// assignment control functioning.
561 
562  /// Instance of the group of setting which
563  /// the given set of settings belongs to.
564  const SettingGroup& group() const
565  {
566  return bboTracking_.group();
567  }
568 
569  /// Re-initializes as a copy of the other instance
570  /// without involving value assignment control services.
572  {
573  maintain_ = other.maintain_;
574 
575  bboTracking_.assignNoControl(other.bboTracking_);
576  }
577 
578 private:
579  // Indicates whether feature is enabled.
580  bool maintain_;
581 
582  // Parameters for tracking.
583  BboTracking bboTracking_;
584 };
585 
586 /// Parameters affecting book management machinery for
587 /// a particular book type (direct, implied, consolidated).
588 template <class BboTracking, typename Depth>
589 class FixedDepthBookManagement : public BaseBookManagement<BboTracking>
590 {
591 public:
592  /// Initializes instance with defaults
593  /// and optional grouping facilities.
594  FixedDepthBookManagement(const SettingGroup* group = ONIXS_CMEMDH_NULLPTR, Depth defaultDepth = 0)
595  : Base(group)
596  , defaultDepth_(defaultDepth)
597  {
598  }
599 
600  /// Initializes the instance
601  /// as a copy of the other one.
602  ///
603  /// Attributes controlling value
604  /// assignment aren't cloned and
605  /// thus only settings are copied.
607  : Base(static_cast<const Base&>(other))
608  , defaultDepth_(other.defaultDepth_)
609  {
610  }
611 
612  /// Finalizes the instance.
614 
615  /// Defines default depth of order book for
616  /// the security whose definition wasn't
617  /// received or had no corresponding data.
618  Depth defaultDepth() const
619  {
620  return defaultDepth_;
621  }
622 
623  /// Defines default depth of order book for
624  /// the security whose definition wasn't
625  /// received or had no corresponding data.
627  {
628  this->group().controlAssignment("Default Depth", defaultDepth_, value);
629 
630  return *this;
631  }
632 
633  /// Re-initializes the instance
634  /// as a copy of the other one.
635  ///
636  /// Attributes controlling value
637  /// assignment aren't cloned and
638  /// thus only settings are copied.
640  {
641  this->group().controlChange(
642  "Fixed Depth Book Management Settings", &FixedDepthBookManagement::assignNoControl, *this, other
643  );
644 
645  return *this;
646  }
647 
648 private:
649  // Lets grouping and value assignment control functioning.
651 
652  // Alias for the base class.
654 
655  //
656 
657  Depth defaultDepth_;
658 
659  // Re-initializes as a copy of the other instance
660  // without involving value assignment control services.
661  void assignNoControl(const FixedDepthBookManagement& other)
662  {
663  Base::assignNoControl(other);
664 
665  defaultDepth_ = other.defaultDepth_;
666  }
667 };
668 
669 /// Parameters affecting book management machinery
670 /// for a books having variable depth like MBO ones.
671 template <class BboTracking, typename Depth>
672 class AnyDepthBookManagement : public BaseBookManagement<BboTracking>
673 {
674 public:
675  /// Initializes the instance with default values.
676  /// Optional parameter to enable grouping facilities.
678  : Base(group)
679  {
680  }
681 
682  /// Initializes the instance
683  /// as a copy of the other one.
684  ///
685  /// Attributes controlling value
686  /// assignment aren't cloned and
687  /// thus only settings are copied.
689  : Base(static_cast<const Base&>(other))
690  {
691  }
692 
693  /// Re-initializes the instance
694  /// as a copy of the other one.
695  ///
696  /// Attributes controlling value
697  /// assignment aren't cloned and
698  /// thus only settings are copied.
700  {
701  this->group().controlChange(
702  "Any Depth Book Management Settings", &AnyDepthBookManagement::assignNoControl, *this, other
703  );
704 
705  return *this;
706  }
707 
708 private:
709  // Lets grouping and value assignment control functioning.
711 
712  // Alias for the base class.
714 
715  Depth reserved_;
716 
717  // Re-initializes as a copy of the other instance
718  // without involving value assignment control services.
719  void assignNoControl(const AnyDepthBookManagement& other)
720  {
721  Base::assignNoControl(other);
722  }
723 };
724 
725 /// Defines book update notification strategies.
727 {
728  /// Integral type used as basement for constants.
729  typedef UInt32 Base;
730 
731  enum Enum
732  {
733  /// Book update event is raised once security id is changed in
734  /// sequence of market data entries being processed by the Handler.
735  ///
736  /// @warning Given strategy does not follow MDP policy
737  /// on exposing order books and thus can be used on own risk!
738  /// Also, books may not be in a valid state (especially consolidated),
739  /// as far as exposed earlier than data for entire market event
740  /// is processed.
742 
743  /// Book update event is raised at the end of market event.
744  ///
745  /// Direct books updates are raised at the end of real
746  /// quotes updates, implied books updates are raised at
747  /// the end of implied quotes updates and consolidated
748  /// books updates are raised at the end of entire event.
749  OnEndOfEvent
750  };
751 };
752 
753 /// Serializes book update notification policy into a string.
755 void toStr(std::string&, BookUpdateNotification::Enum);
756 
757 /// Serializes book update notification policy into a string.
758 inline std::string toStr(BookUpdateNotification::Enum strategy)
759 {
760  std::string str;
761 
762  toStr(str, strategy);
763 
764  return str;
765 }
766 
767 // Aliases for instantiations.
768 
769 /// Management and tracking parameters for MBO books.
771 
772 /// Management and tracking parameters for direct books.
774 
775 /// Management and tracking parameters for implied books.
777 
778 /// Management and tracking parameters for consolidated books.
780 
781 /// Parameters affecting book management machinery.
783 {
784 public:
785  /// Initializes instance with default values.
787  : SettingGroup(controller)
788  , mboBooks_(&group())
789  , directBooks_(&group(), 10)
790  , impliedBooks_(&group(), 2)
791  , updateNotification_(BookUpdateNotification::OnEndOfEvent)
792  {
793  }
794 
795  /// Initializes the instance
796  /// as a copy of the other one.
797  ///
798  /// Attributes controlling value
799  /// assignment aren't cloned and
800  /// thus only settings are copied.
802  : SettingGroup()
803  , mboBooks_(other.mboBooks_)
804  , directBooks_(other.directBooks_)
805  , impliedBooks_(other.impliedBooks_)
806  , consolidatedBooks_(other.consolidatedBooks_)
807  , updateNotification_(other.updateNotification_)
808  {
809  }
810 
811  // Finalizes the instance.
813 
814  /// Management and tracking parameters for direct books.
816  {
817  return mboBooks_;
818  }
819 
820  /// Management and tracking parameters for direct books.
822  {
823  return mboBooks_;
824  }
825 
826  /// Management and tracking parameters for direct books.
828  {
829  return directBooks_;
830  }
831 
832  /// Management and tracking parameters for direct books.
834  {
835  return directBooks_;
836  }
837 
838  /// Management and tracking parameters for implied books.
840  {
841  return impliedBooks_;
842  }
843 
844  /// Management and tracking parameters for implied books.
846  {
847  return impliedBooks_;
848  }
849 
850  /// Management and tracking parameters for consolidated books.
852  {
853  return consolidatedBooks_;
854  }
855 
856  /// Management and tracking parameters for consolidated books.
858  {
859  return consolidatedBooks_;
860  }
861 
862  /// Defines the way Handler raises onBookUpdated callbacks.
863  ///
864  /// @note Default is BookUpdateNotification::OnEndOfEvent.
866  {
867  return updateNotification_;
868  }
869 
870  /// Defines the way Handler raises order book update event.
872  {
873  group().controlAssignment("Update Notification", updateNotification_, value);
874 
875  return *this;
876  }
877 
878  /// Copies settings from the given instance.
879  ///
880  /// Attributes controlling value assignment aren't
881  /// cloned and thus only settings' values are copied.
883  {
884  group().controlChange("Book Management Settings", &BookManagement::assignNoControl, *this, other);
885 
886  return *this;
887  }
888 
889 private:
890  // Lets grouping and value
891  // assignment control functioning.
893 
894  // Subsets of parameters.
895 
896  MboBookManagement mboBooks_;
897 
898  DirectBookManagement directBooks_;
899  ImpliedBookManagement impliedBooks_;
900 
901  ConsolidatedBookManagement consolidatedBooks_;
902 
903  BookUpdateNotification::Enum updateNotification_;
904 
905  // Casts the given instance to an
906  // instance of SettingGroup class.
907  const SettingGroup& group() const
908  {
909  return *this;
910  }
911 
912  // Re-initializes the given instance
913  // as a copy of the other one without
914  // involving assignment control service.
915  void assignNoControl(const BookManagement& other)
916  {
917  mboBooks_.assignNoControl(other.mboBooks_);
918 
919  directBooks_.assignNoControl(other.directBooks_);
920 
921  impliedBooks_.assignNoControl(other.impliedBooks_);
922 
923  consolidatedBooks_.assignNoControl(other.consolidatedBooks_);
924 
925  updateNotification_ = other.updateNotification_;
926  }
927 };
928 
929 /// Serializes book management settings into string.
931 void toStr(std::string&, const BookManagement&);
932 
933 /// Serializes book management settings into string.
934 inline std::string toStr(const BookManagement& settings)
935 {
936  std::string str;
937 
938  toStr(str, settings);
939 
940  return str;
941 }
942 
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&#39;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.
Int32 Int32
int32.
Definition: Fields.h:60
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&#39;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.
UInt32 UInt32
uInt32.
Definition: Fields.h:192
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
Definition: Compiler.h:145
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.
Definition: Order.h:72
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
Definition: Bootstrap.h:46
const Decimal & price() const
Order price.
Definition: Order.h:118
MboBboTracking & operator=(const MboBboTracking &other)
Re-initializes the instance as a copy of the other one.
Mantissa mantissa() const
Returns mantissa of given decimal.
Definition: Decimal.h:176
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.
Definition: SettingGroup.h:107
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 &current) 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.
Definition: Decimal.h:136
const SettingGroup & group() const
Instance of the group of setting which the given set of settings belongs to.
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
Definition: Bootstrap.h:67
bool exceeded(const ImpliedPriceLevel &previous, const ImpliedPriceLevel &current) 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.
Definition: SettingGroup.h:91
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
Definition: Compiler.h:135
#define ONIXS_CMEMDH_LTWT_CLASS_DECL(name)
Definition: Bootstrap.h:48
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.
Definition: SettingGroup.h:33
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 &current) 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&#39;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...
Definition: SettingGroup.h:118
void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
#define ONIXS_CMEMDH_NAMESPACE_END
Definition: Bootstrap.h:68