From d23e2ed4d484514aefbf377bc006064afa995628 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sat, 30 Nov 2024 20:24:45 -0600 Subject: [PATCH] feat(trading): trb data structures --- posts/trading/extrema-circular-buffer.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/posts/trading/extrema-circular-buffer.html b/posts/trading/extrema-circular-buffer.html index 00c63c0..940579b 100644 --- a/posts/trading/extrema-circular-buffer.html +++ b/posts/trading/extrema-circular-buffer.html @@ -200,19 +200,19 @@

further improvements

+

+ The final implementation utilized in the TRB includes the + following features: +

  1. - The class could leverage templates to take in a comparator - std::less<double> - ) to easily specify a minimum/maximum - ExtremaCircularBuffer - as well as a value type to support all operations. + A ringbuffer a statically-allocated std::array, as + any fix-sized queue can be supplanted with one
  2. +
  3. A templatized value type and comparator for flexibility
  4. - As it stands, the class also only maintains one of either - extrema, and using two monotonic deques, while still - theoretically optimal, doesn't give me a good - feeling. The second map-based approach might be favorable here. + C++ specific optimizations (rule of 5, smart pointers, and an + STL-compliant API)