pub enum Indicator {
Sma(usize),
Ema(usize),
Wma(usize),
Bollinger(usize, f64),
Macd(usize, usize, usize, MacdPart),
Rsi(usize),
Atr(usize),
Vwap,
Stochastic(usize, usize),
ZigZag(f64),
}Expand description
A technical indicator.
Variants§
Sma(usize)
Simple moving average over n periods.
Ema(usize)
Exponential moving average (α = 2/(n+1), SMA-seeded).
Wma(usize)
Linearly weighted moving average.
Bollinger(usize, f64)
Bollinger bands: SMA(n) ± k population standard deviations.
Macd(usize, usize, usize, MacdPart)
MACD(fast, slow, signal).
Rsi(usize)
Relative strength index (Wilder), 0–100.
Atr(usize)
Average true range (Wilder); needs high/low/close.
Vwap
Volume-weighted average price, cumulative; volume from weight.
Stochastic(usize, usize)
Stochastic %K over k periods smoothed by an SMA of d (d = 1
for raw %K); needs high/low/close. 0–100.
ZigZag(f64)
ZigZag pivots: points where the price reverses by at least pct %.
Trait Implementations§
impl Copy for Indicator
impl StructuralPartialEq for Indicator
Auto Trait Implementations§
impl Freeze for Indicator
impl RefUnwindSafe for Indicator
impl Send for Indicator
impl Sync for Indicator
impl Unpin for Indicator
impl UnsafeUnpin for Indicator
impl UnwindSafe for Indicator
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