pub struct SmaCrossover {
pub fast_period: usize,
pub slow_period: usize,
pub allow_short: bool,
}Expand description
SMA Crossover Strategy
Goes long when fast SMA crosses above slow SMA. Exits when fast SMA crosses below slow SMA. Optionally goes short on bearish crossovers.
Fields§
§fast_period: usizeFast SMA period
slow_period: usizeSlow SMA period
allow_short: boolAllow short positions
Implementations§
Source§impl SmaCrossover
impl SmaCrossover
Trait Implementations§
Source§impl Clone for SmaCrossover
impl Clone for SmaCrossover
Source§fn clone(&self) -> SmaCrossover
fn clone(&self) -> SmaCrossover
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SmaCrossover
impl Debug for SmaCrossover
Source§impl Default for SmaCrossover
impl Default for SmaCrossover
Source§impl Strategy for SmaCrossover
impl Strategy for SmaCrossover
Auto Trait Implementations§
impl Freeze for SmaCrossover
impl RefUnwindSafe for SmaCrossover
impl Send for SmaCrossover
impl Sync for SmaCrossover
impl Unpin for SmaCrossover
impl UnsafeUnpin for SmaCrossover
impl UnwindSafe for SmaCrossover
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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