feat(trading): trb data structures

This commit is contained in:
Barrett Ruth 2024-11-30 20:24:45 -06:00
parent 3c949f3da3
commit d23e2ed4d4

View file

@ -200,19 +200,19 @@
</p>
<div class="code" data-file="monotonic.cpp"></div>
<h3>further improvements</h3>
<p>
The final implementation utilized in the TRB includes the
following features:
</p>
<ol>
<li>
The class could leverage templates to take in a comparator
<span><code>std::less&lt;double&gt;</code></span>
) to easily specify a minimum/maximum
<span><code>ExtremaCircularBuffer</code></span>
as well as a value type to support all operations.
A ringbuffer a statically-allocated <code>std::array</code>, as
any fix-sized queue can be supplanted with one
</li>
<li>A templatized value type and comparator for flexibility</li>
<li>
As it stands, the class also only maintains one of either
extrema, and using two monotonic deques, while still
<i>theoretically</i> optimal, doesn&apos;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)
</li>
</ol>
</div>