pub struct AverageLine {
pub kind: AverageType,
pub period: usize,
pub source: PriceSource,
pub color: Color32,
}Expand description
One moving average’s formula, length, input price and colour.
Fields§
§kind: AverageTypeAverage formula.
period: usizeWindow length; zero is treated as one (Hull requires two).
source: PriceSourceSource price; defaults to close.
color: Color32Line colour.
Implementations§
Source§impl AverageLine
impl AverageLine
Sourcepub fn new(kind: AverageType, period: usize, color: Color32) -> Self
pub fn new(kind: AverageType, period: usize, color: Color32) -> Self
A moving average of closing prices.
Sourcepub fn with_source(self, source: PriceSource) -> Self
pub fn with_source(self, source: PriceSource) -> Self
Select this line’s input price independently of the other lines.
Trait Implementations§
Source§impl Clone for AverageLine
impl Clone for AverageLine
Source§fn clone(&self) -> AverageLine
fn clone(&self) -> AverageLine
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 AverageLine
impl RefUnwindSafe for AverageLine
impl Send for AverageLine
impl Sync for AverageLine
impl Unpin for AverageLine
impl UnsafeUnpin for AverageLine
impl UnwindSafe for AverageLine
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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