pub struct PriceVolumeTrend { /* private fields */ }Expand description
Price Volume Trend: volume weighted by the relative price change, accumulated.
PVT_t = PVT_{t-1} + volume_t * (close_t / close_{t-1} - 1)
The distinction to its neighbours is the weighting, and it is the whole point:
- OBV adds the full volume with the sign of the change — a one-cent move counts as much as a five-percent one.
- Elder’s Force Index weights by the absolute change, so the same percentage move counts more at a higher price level.
- PVT weights by the relative change, which makes its steps comparable across price levels within one series.
Unit: volume units. A cumulative total is only meaningful relative to itself — its level says nothing without the series it was accumulated over, and comparing the level between two instruments compares their volume conventions, not their flows.
The running total starts at zero on the first bar that has a predecessor. There is no output
on the very first bar of a series: without a previous close there is no return, and a zero
would claim one. Indicator::reset returns the total to zero, so a series switch starts a
fresh accumulation rather than carrying a level across a boundary it has no meaning over.
Implementations§
Trait Implementations§
Source§impl Clone for PriceVolumeTrend
impl Clone for PriceVolumeTrend
Source§fn clone(&self) -> PriceVolumeTrend
fn clone(&self) -> PriceVolumeTrend
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PriceVolumeTrend
impl Debug for PriceVolumeTrend
Source§impl Default for PriceVolumeTrend
impl Default for PriceVolumeTrend
Source§fn default() -> PriceVolumeTrend
fn default() -> PriceVolumeTrend
Source§impl Indicator for PriceVolumeTrend
impl Indicator for PriceVolumeTrend
fn name(&self) -> &str
fn warmup_period(&self) -> usize
fn on_bar(&mut self, bar: &Bar) -> Option<IndicatorOutput>
fn reset(&mut self)
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.