pub struct Macd { /* private fields */ }Expand description
Moving Average Convergence Divergence.
MACD = Ema(fast_len)(close) - Ema(slow_len)(close), both the shared Ema with its
first-sample seed, running from the first bar; the line is published from the slow_len-th bar
on. extra["signal"] is an Ema(signal_len) over the published MACD values, seeded with the
first of them, and extra["hist"] is MACD - signal. Alerts fire on signal and zero crosses.
First output: with the slow_len-th bar. Indicator::reset clears all three averages.
Implementations§
Trait Implementations§
Source§impl Indicator for Macd
impl Indicator for Macd
fn name(&self) -> &str
fn warmup_period(&self) -> usize
fn on_bar(&mut self, bar: &Bar) -> Option<IndicatorOutput>
fn reset(&mut self)
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 Macd
impl RefUnwindSafe for Macd
impl Send for Macd
impl Sync for Macd
impl Unpin for Macd
impl UnsafeUnpin for Macd
impl UnwindSafe for Macd
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