pub struct Maximum { /* private fields */ }
Expand description
Returns the highest value in a given time frame.
§Parameters
- n - size of the time frame (integer greater than 0). Default value is 14.
§Example
use ta::indicators::Maximum;
use ta::{Calculate, Next};
let mut max = Maximum::new(3).unwrap();
assert_eq!(max.calc(7.0), 7.0);
assert_eq!(max.calc(5.0), 7.0);
assert_eq!(max.calc(4.0), 7.0);
assert_eq!(max.calc(4.0), 5.0);
assert_eq!(max.calc(8.0), 8.0);
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Maximum
impl RefUnwindSafe for Maximum
impl Send for Maximum
impl Sync for Maximum
impl Unpin for Maximum
impl UnwindSafe for Maximum
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