pub struct SessionVwap { /* private fields */ }Expand description
Session Volume Weighted Average Price (VWAP) with Standard Deviation Bands.
Accumulates volume-weighted typical price across intraday bars and resets
whenever is_session_start is true.
Typical Price: $$TP = \frac{\text{High} + \text{Low} + \text{Close}}{3}$$
Running VWAP: $$VWAP = \frac{\sum (TP \cdot Volume)}{\sum Volume}$$
Running Volume-Weighted Standard Deviation: $$\sigma = \sqrt{\frac{\sum Volume \cdot (TP - VWAP)^2}{\sum Volume}}$$
Standard Deviation Bands: $$\text{Upper}_k = VWAP + k \cdot \sigma, \quad \text{Lower}_k = VWAP - k \cdot \sigma \quad (k \in {1, 2, 3})$$
Implementations§
Source§impl SessionVwap
impl SessionVwap
Sourcepub fn cumulative_volume(&self) -> f64
pub fn cumulative_volume(&self) -> f64
Returns the total volume accumulated in the current session.
Sourcepub fn current_vwap(&self) -> f64
pub fn current_vwap(&self) -> f64
Returns the current VWAP level for the session.
Sourcepub fn current_bar_index(&self) -> usize
pub fn current_bar_index(&self) -> usize
Returns the 0-indexed count of bars processed in the current session.
Trait Implementations§
Source§impl Clone for SessionVwap
impl Clone for SessionVwap
Source§impl Debug for SessionVwap
impl Debug for SessionVwap
Source§impl Default for SessionVwap
impl Default for SessionVwap
Source§impl<'de> Deserialize<'de> for SessionVwap
impl<'de> Deserialize<'de> for SessionVwap
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>,
Source§impl Next<(f64, f64, f64, f64, bool)> for SessionVwap
impl Next<(f64, f64, f64, f64, bool)> for SessionVwap
Source§impl Next<SessionVwapInput> for SessionVwap
impl Next<SessionVwapInput> for SessionVwap
type Output = SessionVwapState
Source§fn next(&mut self, input: SessionVwapInput) -> Self::Output
fn next(&mut self, input: SessionVwapInput) -> Self::Output
Source§impl PartialEq for SessionVwap
impl PartialEq for SessionVwap
Source§impl Serialize for SessionVwap
impl Serialize for SessionVwap
impl StructuralPartialEq for SessionVwap
Auto Trait Implementations§
impl Forget for SessionVwap
impl Freeze for SessionVwap
impl Move for SessionVwap
impl RefUnwindSafe for SessionVwap
impl Send for SessionVwap
impl Sync for SessionVwap
impl Unpin for SessionVwap
impl UnsafeUnpin for SessionVwap
impl UnwindSafe for SessionVwap
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
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.