Summary
DollarRunBarGenerator implements a constant-threshold dollar run bar. It
accumulates buy and sell notional value separately throughout the active bar
and closes when the dominant side reaches threshold.
Update API
ind = rtta.DollarRunBarGenerator(threshold=1.0e6)
result = ind.update(close, volume)
# result.bar_open, bar_close, bar_high, bar_low, bar_volume,
# result.direction, result.complete, result.bars
Although retained for compatibility with InformationBarResult, bar_volume
contains dominant-side dollar value for this generator.
Theory Of Operation
Dollar run bars combine order-flow direction with notional-value sampling. They measure cumulative one-sided money flow, not a consecutive same-sign streak: an opposite tick adds to the other side without discarding either tally or resetting OHLC. RTTA applies a fixed threshold to the canonical dominant-side statistic.
Recurrence
Classify price using the tick rule, with a flat tick inheriting the latest nonzero sign, and define
For the active bar, maintain
When \(\theta_t\ge\texttt{threshold}\), the bar completes, bar_volume is
\(\theta_t\), and direction identifies the dominant side. Incomplete results
report the current \(\theta_t\) and direction zero. OHLC covers every tick
assigned to the bar.
After completion the dollar totals and OHLC reset, while previous price and tick sign carry across the boundary. The first observation seeds price and has no signed dollar contribution.
Implementation Notes
The recurrence is implemented in src/rtta/indicator.cpp in
class DollarRunBarGenerator. The default threshold is \(10^6\).
