pub struct GarmanKlassVolatilityEngine { /* private fields */ }Expand description
Garman-Klass volatility from open, high, low and close, annualised, in percent.
Per bar 0.5 * ln(high/low)^2 - (2 ln 2 - 1) * ln(close/open)^2, floored at zero and skipped
for non-positive prices; the mean over the last period bars is rooted, annualised with
sqrt(252) and scaled by 100.
First output: with the period-th bar. Indicator::reset clears the window.
Implementations§
Trait Implementations§
Source§impl Indicator for GarmanKlassVolatilityEngine
impl Indicator for GarmanKlassVolatilityEngine
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 GarmanKlassVolatilityEngine
impl RefUnwindSafe for GarmanKlassVolatilityEngine
impl Send for GarmanKlassVolatilityEngine
impl Sync for GarmanKlassVolatilityEngine
impl Unpin for GarmanKlassVolatilityEngine
impl UnsafeUnpin for GarmanKlassVolatilityEngine
impl UnwindSafe for GarmanKlassVolatilityEngine
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