pub struct VolumeEngine { /* private fields */ }Expand description
Bar volume with its moving average.
value is the bar’s own volume. Once ma_period volumes have been seen, extra adds
avg_volume — the plain mean of the last ma_period volumes, this bar included — and
volume_ratio = volume / avg_volume (1 for a zero average); a volume above twice the average
raises an alert. Before that, only the volume itself is published.
First output: with the first bar. Indicator::reset clears the window.
Implementations§
Trait Implementations§
Source§impl Indicator for VolumeEngine
impl Indicator for VolumeEngine
fn name(&self) -> &str
fn warmup_period(&self) -> usize
fn reset(&mut self)
fn on_bar(&mut self, bar: &Bar) -> Option<IndicatorOutput>
fn alerts(&self) -> Vec<IndicatorAlert>
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>
Validates a bar before forwarding it to
Indicator::on_bar.Auto Trait Implementations§
impl Freeze for VolumeEngine
impl RefUnwindSafe for VolumeEngine
impl Send for VolumeEngine
impl Sync for VolumeEngine
impl Unpin for VolumeEngine
impl UnsafeUnpin for VolumeEngine
impl UnwindSafe for VolumeEngine
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