pub struct HistoricalVolatilityEngine { /* private fields */ }Expand description
Historical volatility: the annualised standard deviation of log returns, in percent.
Over the last period + 1 closes, the period log returns ln(close_t / close_{t-1}) (0 for a
non-positive price) give a sample standard deviation (divisor period - 1, at least 1),
annualised with sqrt(252) and scaled by 100.
First output: with the period + 1-th bar. Indicator::reset clears the window.
Implementations§
Trait Implementations§
Source§impl Indicator for HistoricalVolatilityEngine
impl Indicator for HistoricalVolatilityEngine
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 HistoricalVolatilityEngine
impl RefUnwindSafe for HistoricalVolatilityEngine
impl Send for HistoricalVolatilityEngine
impl Sync for HistoricalVolatilityEngine
impl Unpin for HistoricalVolatilityEngine
impl UnsafeUnpin for HistoricalVolatilityEngine
impl UnwindSafe for HistoricalVolatilityEngine
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