pub struct SmaEngine { /* private fields */ }Expand description
Simple Moving Average (SMA) over the closing price.
SMA_t = (close_t + ... + close_{t-period+1}) / period, the plain mean of the last period
closes.
First output: with the period-th bar. Indicator::reset clears the window.
Implementations§
Trait Implementations§
Source§impl Indicator for SmaEngine
impl Indicator for SmaEngine
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 SmaEngine
impl RefUnwindSafe for SmaEngine
impl Send for SmaEngine
impl Sync for SmaEngine
impl Unpin for SmaEngine
impl UnsafeUnpin for SmaEngine
impl UnwindSafe for SmaEngine
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