pub struct Mfi { /* private fields */ }Expand description
Money Flow Index, smoothed, with a signal line.
Per bar the raw money flow is typical * volume, typical = (high + low + close) / 3; it counts
as positive when the typical price rose against the previous bar, negative when it fell, and not
at all on the first bar or when unchanged. Over the last mfi_len bars
raw = 100 - 100 / (1 + positive / negative), with 50 without any flow, 100 without negative
and 0 without positive flow. value is the line, Ema(avg_len) of the raw MFI with the
first-sample seed; extra["signal"] is Ema(sig_len) of the line. Alerts require volume.
First output: with the mfi_len-th bar. Indicator::reset clears the window and averages.
Implementations§
Trait Implementations§
Source§impl Indicator for Mfi
impl Indicator for Mfi
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 Mfi
impl RefUnwindSafe for Mfi
impl Send for Mfi
impl Sync for Mfi
impl Unpin for Mfi
impl UnsafeUnpin for Mfi
impl UnwindSafe for Mfi
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