pub struct SMAPeriods {
pub short: SimpleMovingAverage,
pub medium: SimpleMovingAverage,
pub long: SimpleMovingAverage,
}Expand description
Holds SMA indicators for different periods.
Fields§
§short: SimpleMovingAverageShort period SMA.
medium: SimpleMovingAverageMedium period SMA.
long: SimpleMovingAverageLong period SMA.
Implementations§
Source§impl SMAPeriods
impl SMAPeriods
Sourcepub fn new(
short: Option<usize>,
medium: Option<usize>,
long: Option<usize>,
) -> Result<Self, SMAError>
pub fn new( short: Option<usize>, medium: Option<usize>, long: Option<usize>, ) -> Result<Self, SMAError>
Creates a new set of SMA indicators with the following periods:
- Short: defaults to 20 if not provided.
- Medium: defaults to 50 if not provided.
- Long: defaults to 200 if not provided.
Sourcepub fn get_values(&mut self) -> SMAValues
pub fn get_values(&mut self) -> SMAValues
Retrieves the current SMA values.
Auto Trait Implementations§
impl Freeze for SMAPeriods
impl RefUnwindSafe for SMAPeriods
impl Send for SMAPeriods
impl Sync for SMAPeriods
impl Unpin for SMAPeriods
impl UnwindSafe for SMAPeriods
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