pub struct ADX { /* private fields */ }Expand description
Average Directional Index (ADX) calculator
Measures trend strength (not direction). Values above 25 typically indicate a strong trend, while values below 20 suggest a ranging market.
Also provides +DI and -DI for trend direction via trend_direction().
Implementations§
Source§impl ADX
impl ADX
Sourcepub fn update(&mut self, high: f64, low: f64, close: f64) -> Option<f64>
pub fn update(&mut self, high: f64, low: f64, close: f64) -> Option<f64>
Update with HLC data, returning the ADX value if warmed up
Sourcepub fn plus_dir_index(&self) -> Option<f64>
pub fn plus_dir_index(&self) -> Option<f64>
Get the +DI value
Sourcepub fn minus_dir_index(&self) -> Option<f64>
pub fn minus_dir_index(&self) -> Option<f64>
Get the -DI value
Sourcepub fn trend_direction(&self) -> Option<TrendDirection>
pub fn trend_direction(&self) -> Option<TrendDirection>
Returns trend direction based on DI crossover.
+DI > -DI→ Bullish-DI > +DI→ Bearish
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ADX
impl RefUnwindSafe for ADX
impl Send for ADX
impl Sync for ADX
impl Unpin for ADX
impl UnsafeUnpin for ADX
impl UnwindSafe for ADX
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