pub struct StdDev { /* private fields */ }Expand description
Standard Deviation indicator.
Measures price dispersion around the mean. Higher values indicate higher volatility.
§Examples
use velora_ta::{StdDev, SingleIndicator};
use chrono::Utc;
let mut std_dev = StdDev::new(20).unwrap();
let timestamp = Utc::now();
for price in vec![100.0, 105.0, 95.0, 110.0, 90.0] {
if let Some(value) = std_dev.update(price, timestamp).unwrap() {
println!("StdDev: {:.2}", value);
}
}Implementations§
Trait Implementations§
Source§impl Indicator for StdDev
impl Indicator for StdDev
Auto Trait Implementations§
impl Freeze for StdDev
impl RefUnwindSafe for StdDev
impl Send for StdDev
impl Sync for StdDev
impl Unpin for StdDev
impl UnwindSafe for StdDev
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