pub struct DonchianState { /* private fields */ }Expand description
Incremental Donchian.
Implementations§
Source§impl DonchianState
impl DonchianState
pub fn new(params: DonchianParams) -> FinanceResult<Self>
pub fn from_history( params: DonchianParams, high: &[f64], low: &[f64], ) -> FinanceResult<Self>
pub fn params(&self) -> DonchianParams
pub fn reset(&mut self)
pub fn push( &mut self, high: f64, low: f64, ) -> FinanceResult<Option<DonchianBarOutput>>
pub fn push_bars( &mut self, high: &[f64], low: &[f64], ) -> FinanceResult<Vec<Option<DonchianBarOutput>>>
pub fn last(&self) -> Option<DonchianBarOutput>
Trait Implementations§
Source§impl Clone for DonchianState
impl Clone for DonchianState
Source§fn clone(&self) -> DonchianState
fn clone(&self) -> DonchianState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DonchianState
impl RefUnwindSafe for DonchianState
impl Send for DonchianState
impl Sync for DonchianState
impl Unpin for DonchianState
impl UnsafeUnpin for DonchianState
impl UnwindSafe for DonchianState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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