|
ITCHCPP 1.6.0
High-Performance NASDAQ TotalView-ITCH 5.0 Parser & Market-Data Platform
|
Builds OHLCV bars from a trade stream under a configurable clock. More...
#include <bars.hpp>
Public Member Functions | |
| BarBuilder (Clock clock, BarCallback callback) | |
| Constructs a builder with the given clock policy and completion callback. | |
| auto | add (const Trade &trade) -> void |
| Adds one trade, emitting the previous bar when the bucket changes. | |
| auto | flush () -> void |
| Emits the current partial bar, if any, and clears it. | |
Builds OHLCV bars from a trade stream under a configurable clock.
Feed trades in timestamp order with add; each time the clock's bucket id changes, the completed bar is emitted to the callback. flush emits the final, partial bar. The clock is a small policy (see TimeClock, TickClock, VolumeClock) so time-, tick-, and volume-based aggregation share one builder.
|
inline |
|
inline |
Adds one trade, emitting the previous bar when the bucket changes.
| trade | The next trade in timestamp order to fold into the current bar. |
Definition at line 100 of file bars.hpp.
References itch::analytics::Bar::bucket, itch::analytics::Bar::close, itch::analytics::Bar::end_timestamp, itch::analytics::Bar::high, itch::analytics::Bar::low, itch::analytics::Bar::open, itch::analytics::Bar::start_timestamp, itch::analytics::Bar::trade_count, and itch::analytics::Bar::volume.
|
inline |