pub struct CvdEngine { /* private fields */ }Expand description
Cumulative Volume Delta (CVD) Engine.
Derives the buying/selling split from the shape of each bar — where the close sits inside its
range — which is super::cvd_intrabar::DeltaProvenance::BarShape. It looks at no individual
trade and cannot tell aggressive buying from selling into absorption: both can close at the
high. That is a documented estimate, not a measurement of the aggressor, and it remains this
crate’s default. super::cvd_intrabar::IntrabarCvd offers the finer estimate from
lower-timeframe bars without replacing this one.
Per bar, with the range floored at 1e-8: share = (close - low) / (high - low),
buy = volume * share, sell = volume * (1 - share), delta = buy - sell. value is the
running total of the deltas; extra carries this bar’s delta, buy_volume and
sell_volume. First output: with the first bar. Indicator::reset returns the total to
zero.
Implementations§
Trait Implementations§
Source§impl Indicator for CvdEngine
impl Indicator for CvdEngine
fn name(&self) -> &str
fn warmup_period(&self) -> usize
fn reset(&mut self)
fn on_bar(&mut self, bar: &Bar) -> Option<IndicatorOutput>
fn alerts(&self) -> Vec<IndicatorAlert>
Source§fn on_checked_bar(
&mut self,
bar: &Bar,
) -> Result<Option<IndicatorOutput>, BarValidationError>
fn on_checked_bar( &mut self, bar: &Bar, ) -> Result<Option<IndicatorOutput>, BarValidationError>
Indicator::on_bar.