pub struct VolumeProfileState {
pub poc: f64,
pub vah: f64,
pub val: f64,
pub profile_high: f64,
pub profile_low: f64,
pub total_volume: f64,
pub bar_index: usize,
}Expand description
Output state emitted by VolumeProfile for each bar.
Fields§
§poc: f64Point of Control (POC): center price of the bin with the highest volume.
vah: f64Value Area High (VAH): upper price boundary of the Value Area.
val: f64Value Area Low (VAL): lower price boundary of the Value Area.
profile_high: f64Highest price observed in the rolling window.
profile_low: f64Lowest price observed in the rolling window.
total_volume: f64Total traded volume accumulated across the rolling window.
bar_index: usizeZero-based index of the most recently processed bar.
Implementations§
Source§impl VolumeProfileState
impl VolumeProfileState
Sourcepub fn empty(bar_index: usize) -> Self
pub fn empty(bar_index: usize) -> Self
Creates an empty/uninitialized state with NaN prices and zero volume.
Sourcepub fn value_area_width(&self) -> f64
pub fn value_area_width(&self) -> f64
Price span of the Value Area (vah - val).
Sourcepub fn profile_range(&self) -> f64
pub fn profile_range(&self) -> f64
Price span of the entire profile (profile_high - profile_low).
Sourcepub fn is_inside_value_area(&self, price: f64) -> bool
pub fn is_inside_value_area(&self, price: f64) -> bool
Returns true if price is currently inside the Value Area [val, vah].
Trait Implementations§
Source§impl Clone for VolumeProfileState
impl Clone for VolumeProfileState
impl Copy for VolumeProfileState
Source§impl Debug for VolumeProfileState
impl Debug for VolumeProfileState
Source§impl<'de> Deserialize<'de> for VolumeProfileState
impl<'de> Deserialize<'de> for VolumeProfileState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for VolumeProfileState
impl PartialEq for VolumeProfileState
Source§impl Serialize for VolumeProfileState
impl Serialize for VolumeProfileState
impl StructuralPartialEq for VolumeProfileState
Auto Trait Implementations§
impl Forget for VolumeProfileState
impl Freeze for VolumeProfileState
impl Move for VolumeProfileState
impl RefUnwindSafe for VolumeProfileState
impl Send for VolumeProfileState
impl Sync for VolumeProfileState
impl Unpin for VolumeProfileState
impl UnsafeUnpin for VolumeProfileState
impl UnwindSafe for VolumeProfileState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.