pub struct VolumeProfile { /* private fields */ }Expand description
Auction Market Theory Volume Profile indicator.
Tracks volume distribution across price bins over a rolling lookback window.
Implementations§
Source§impl VolumeProfile
impl VolumeProfile
Sourcepub fn new(period: usize, bins: usize) -> Self
pub fn new(period: usize, bins: usize) -> Self
Creates a new VolumeProfile with default 70% Value Area and Greedy expansion.
§Arguments
period- Sliding window size in bars (minimum 1).bins- Number of price buckets in the histogram (minimum 1).
Sourcepub fn with_value_area_pct(self, pct: f64) -> Self
pub fn with_value_area_pct(self, pct: f64) -> Self
Sets the target percentage of total volume to include in the Value Area.
Value is clamped between 0.0 and 1.0 (default 0.70).
Sourcepub fn with_methods(
self,
va_method: ValueAreaMethod,
alloc_method: VolumeAllocationMethod,
) -> Self
pub fn with_methods( self, va_method: ValueAreaMethod, alloc_method: VolumeAllocationMethod, ) -> Self
Sets the Value Area expansion method and volume allocation method.
Sourcepub fn with_params(
period: usize,
bins: usize,
value_area_pct: f64,
va_method: ValueAreaMethod,
alloc_method: VolumeAllocationMethod,
) -> Self
pub fn with_params( period: usize, bins: usize, value_area_pct: f64, va_method: ValueAreaMethod, alloc_method: VolumeAllocationMethod, ) -> Self
Creates a VolumeProfile with full parameter configuration.
Sourcepub fn value_area_pct(&self) -> f64
pub fn value_area_pct(&self) -> f64
Configured Value Area percentage (e.g. 0.70).
Sourcepub fn value_area_method(&self) -> ValueAreaMethod
pub fn value_area_method(&self) -> ValueAreaMethod
Configured Value Area expansion method.
Sourcepub fn allocation_method(&self) -> VolumeAllocationMethod
pub fn allocation_method(&self) -> VolumeAllocationMethod
Configured volume allocation method.
Sourcepub fn window_len(&self) -> usize
pub fn window_len(&self) -> usize
Number of bars currently in the rolling window.
Sourcepub fn bar_count(&self) -> usize
pub fn bar_count(&self) -> usize
Total number of bars ingested since initialization or last reset.
Sourcepub fn is_ready(&self) -> bool
pub fn is_ready(&self) -> bool
Returns true if the rolling window has reached full capacity (>= period).
Sourcepub fn next_bar(&mut self, bar: impl Into<BarData>) -> VolumeProfileState
pub fn next_bar(&mut self, bar: impl Into<BarData>) -> VolumeProfileState
Ingests a new bar and computes the updated VolumeProfileState.
Sourcepub fn current_bins(&self) -> Vec<PriceBin>
pub fn current_bins(&self) -> Vec<PriceBin>
Computes and returns the full discrete price bins for the current window.
Trait Implementations§
Source§impl Clone for VolumeProfile
impl Clone for VolumeProfile
Source§impl Debug for VolumeProfile
impl Debug for VolumeProfile
Source§impl<'de> Deserialize<'de> for VolumeProfile
impl<'de> Deserialize<'de> for VolumeProfile
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)> for VolumeProfile
Reference &(f64, f64, f64, f64) input.
impl Next<&(f64, f64, f64, f64)> for VolumeProfile
Reference &(f64, f64, f64, f64) input.
Source§impl Next<&BarData> for VolumeProfile
Reference &BarData input.
impl Next<&BarData> for VolumeProfile
Reference &BarData input.
Source§impl Next<(f64, f64)> for VolumeProfile
Legacy single price & volume input: (price, volume).
impl Next<(f64, f64)> for VolumeProfile
Legacy single price & volume input: (price, volume).
Returns the Point of Control (POC) as f64 for backward compatibility with PyO3 bindings.
Source§impl Next<(f64, f64, f64)> for VolumeProfile
Convenience HLV input: (high, low, volume). Close defaults to (high + low) / 2.
impl Next<(f64, f64, f64)> for VolumeProfile
Convenience HLV input: (high, low, volume). Close defaults to (high + low) / 2.
Source§impl Next<(f64, f64, f64, f64)> for VolumeProfile
Full OHLCV input: (high, low, close, volume).
impl Next<(f64, f64, f64, f64)> for VolumeProfile
Full OHLCV input: (high, low, close, volume).
Source§impl Next<BarData> for VolumeProfile
Direct BarData input.
impl Next<BarData> for VolumeProfile
Direct BarData input.
Source§impl PartialEq for VolumeProfile
impl PartialEq for VolumeProfile
Source§impl Serialize for VolumeProfile
impl Serialize for VolumeProfile
impl StructuralPartialEq for VolumeProfile
Auto Trait Implementations§
impl Forget for VolumeProfile
impl Freeze for VolumeProfile
impl Move for VolumeProfile
impl RefUnwindSafe for VolumeProfile
impl Send for VolumeProfile
impl Sync for VolumeProfile
impl Unpin for VolumeProfile
impl UnsafeUnpin for VolumeProfile
impl UnwindSafe for VolumeProfile
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.