Summary
DollarRunBarGenerator is a dollar-weighted run bar: while the tick-rule sign holds,
notional volume \(|\mathrm{close}|\cdot\mathrm{volume}\) accumulates; the bar closes when
run dollar volume reaches a threshold.
Update API
import rtta
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
bar_volume is dollar accumulation of the current run. Flat ticks do not alter the run.
Sign flips restart the run at the current print's dollar volume.
Theory Of Operation
Dollar run bars combine persistence of order-flow sign with notional-value sampling. They close when a one-sided streak has moved a fixed amount of money, blending the ideas of dollar bars and tick run bars from the information-driven bar literature.
Recurrence
Let \(D^\star > 0\) be threshold and \(d_t = |c_t|\,\max(v_t,0)\). Tick sign \(s_t\) is
the same as for volume run bars.
If \(s_t \neq 0\):
When \(D_{\mathrm{run}} \ge D^\star\):
Incomplete ticks report \(\mathrm{bar\_volume}=D_{\mathrm{run}}\).
Implementation Notes
The recurrence is implemented in src/rtta/indicator.cpp in
class DollarRunBarGenerator. Default threshold is \(10^6\).
