pub struct DmiEngine { /* private fields */ }Expand description
Directional Movement Index: +DI and -DI over plain sums.
Per bar from the second one on, +DM, -DM and TR as in super::adx::Adx. Unlike the ADX they
are summed over the last period bars rather than Wilder-smoothed:
+DI = 100 * sum(+DM) / sum(TR), -DI = 100 * sum(-DM) / sum(TR) (0 without range).
value: +DI - -DI — the difference of the two lines, not the directional index DX that
super::adx::Adx computes. extra["plus_di"] and extra["minus_di"] (each clamped to
0..=100) and extra["di_diff"]. Alerts fire when one line leads the other by more than 10.
First output: with the period + 1-th bar. Indicator::reset clears the windows.
Implementations§
Trait Implementations§
Source§impl Indicator for DmiEngine
impl Indicator for DmiEngine
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 DmiEngine
impl RefUnwindSafe for DmiEngine
impl Send for DmiEngine
impl Sync for DmiEngine
impl Unpin for DmiEngine
impl UnsafeUnpin for DmiEngine
impl UnwindSafe for DmiEngine
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