Skip to main content

PriceVolumeTrend

Struct PriceVolumeTrend 

Source
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§

Source§

impl PriceVolumeTrend

Source

pub fn new() -> Self

Trait Implementations§

Source§

impl Clone for PriceVolumeTrend

Source§

fn clone(&self) -> PriceVolumeTrend

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PriceVolumeTrend

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PriceVolumeTrend

Source§

fn default() -> PriceVolumeTrend

Returns the “default value” for a type. Read more
Source§

impl Indicator for PriceVolumeTrend

Source§

fn name(&self) -> &str

Source§

fn warmup_period(&self) -> usize

Source§

fn on_bar(&mut self, bar: &Bar) -> Option<IndicatorOutput>

Source§

fn reset(&mut self)

Source§

fn on_checked_bar( &mut self, bar: &Bar, ) -> Result<Option<IndicatorOutput>, BarValidationError>

Validates a bar before forwarding it to Indicator::on_bar.
Source§

fn alerts(&self) -> Vec<IndicatorAlert>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.