pub struct HarmonicOscillator { /* private fields */ }Expand description
Harmonic Oscillator for detecting cyclical patterns
Detects cyclical patterns via rolling volatility analysis using short and long windows
Implementations§
Source§impl HarmonicOscillator
impl HarmonicOscillator
Sourcepub fn new(short_window_size: usize, long_window_size: usize) -> Self
pub fn new(short_window_size: usize, long_window_size: usize) -> Self
Create a new harmonic oscillator with short and long window sizes
Sourcepub fn update(&mut self, price: Decimal) -> bool
pub fn update(&mut self, price: Decimal) -> bool
Update the oscillator with a new price
Returns true if the update was successful, false if price conversion failed
Sourcepub fn detect_oscillation(&self) -> HarmonicResult
pub fn detect_oscillation(&self) -> HarmonicResult
Detect harmonic oscillations
Auto Trait Implementations§
impl Freeze for HarmonicOscillator
impl RefUnwindSafe for HarmonicOscillator
impl Send for HarmonicOscillator
impl Sync for HarmonicOscillator
impl Unpin for HarmonicOscillator
impl UnwindSafe for HarmonicOscillator
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more